Bug 94246

Summary: [Chromium] Uint8ClampedArray fast path rounds incorrectly
Product: WebKit Reporter: Dominik Röttsches (drott) <d-r>
Component: WebGLAssignee: Ulan Degenbaev <ulan>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, code.vineet, danno, dpranke, kbr, ulan, zmo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Dominik Röttsches (drott) 2012-08-16 13:30:52 PDT
When analysing two philip canvas tests I found that the ArrayBuffer bindings in Chromium have a fast path (ExternalArray) using ArrayBuffer's baseAddress to set indexed properties directly. This fast path does not use the same rounding (round to nearest, even in halfway case, equivalent to lrint()) that was put in place now for Uint8ClampedArray::set in order to adhere to the spec. For 2d.imageData.object.round.html to pass on Chromium, this needs to be fixed. More info in bug 40272.
Comment 1 Kenneth Russell 2012-08-16 16:31:56 PDT
Could you please provide a test case which demonstrates the problem?
Comment 2 Adam Barth 2012-08-16 17:20:29 PDT
There's a test case in bug 40272 that Chromium fails.
Comment 3 Kenneth Russell 2012-08-16 17:31:26 PDT
Filed V8 bug https://code.google.com/p/v8/issues/detail?id=2294 to track this.
Comment 4 Ulan Degenbaev 2012-08-22 08:44:18 PDT
The V8 bug is fixed. I will adjust canvas test expectations after V8 rolls in Chromium.
Comment 5 Kenneth Russell 2012-08-22 13:26:13 PDT
(In reply to comment #4)
> The V8 bug is fixed. I will adjust canvas test expectations after V8 rolls in Chromium.

Ulan, thanks for fixing this. Note that array-unit-tests.html was just updated in the Khronos WebGL github repo, so do you think you could pull in a revised version of this test and its expectations too?
Comment 6 Ulan Degenbaev 2012-08-24 00:37:22 PDT
> Note that array-unit-tests.html was just updated in the Khronos WebGL github repo, so do you think you could pull in a revised version of this test and its expectations too?

Yep, I can update the tests. But it looks like zmo@ is already taking care of this?
Comment 7 Kenneth Russell 2012-08-24 11:28:46 PDT
zmo@ updated the tests in the Khronos repo, but it would be great to pull the revised tests from the Khronos repo back into the WebKit repo as a layout test.
Comment 8 Dominik Röttsches (drott) 2012-08-27 09:17:01 PDT
In Bug 40272 Benjamin requested a better fallback implementation for MSVC & !X86 - you might want to take a look and do something similar in V8.
Comment 9 Dirk Pranke 2012-09-18 17:11:56 PDT
it looks like the following layout tests that were listed as relevant to this bug are no longer failing.

        BUGWK94246 : canvas/philip/tests/2d.imageData.object.round.html = TEXT  
        BUGWK94246 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.imageData.object.round.html = TEXT
        BUGWK94246 : fast/canvas/canvas-ImageData-behaviour.html = TEXT         
        BUGWK94246 : platform/chromium/virtual/gpu/fast/canvas/canvas-ImageData-behaviour.html = TEXT

So I've removed the suppressions in http://trac.webkit.org/changeset/128945 .

Can we now close this? It looks that way from what I can glean from the comments.
Comment 10 Ulan Degenbaev 2012-09-19 00:10:50 PDT
> Can we now close this? It looks that way from what I can glean from the comments.
Yes, V8 with the fix rolled in Chrome.