This test passes fails in the GPU Skia backend when we do the getImageData unpremultiply step on the GPU. The test draws a gradient from c1=(255, 255, 0, 0) to c2=(0, 0, 255, 255) on a x = 0 ... 100 rectangle. It samples the rect at x = 25, 50, and 75. At each sample it asserts that the read value's color components are within three of the expected value. The color expected is (191, 191, 63, 63) which roughly corresponds to .75*c1 + .25*c2 = (191.25, 191.25, 63.75, 63.75). Skia computes the same premultiplied value at the sample point in both the GPU and CPU backends (48, 48, 17, 65). Unpremultiplying gives approximately (188.31, 188.31, 66.69, 65). In the code path where the unpremultiply step is done on the CPU in WebKit code the final value is (188, 188, 66, 65) which barely passes. When the GPU unpremultiply conversion is used Skia gets (188, 188, 67, 65) and so fails by the blue component. Though the GPU conversion pushes us over the edge to failing the test, it isn't the fundamental reason why we fail. The gradient spans the range x = 0 to 100 but Skia samples it at pixel centers falling halfway between integer coords. So we are sampling the gradient at x = 0.5, 1.5,..., 99.5. When we read back the 25th pixel we're getting Skia's computation of .255 * c1 + .745 * c2. The exact answer would be (189.975, 189.75, 65.25, 65.25). If the reference color was the exact color at 25.5 rounded it would be (190, 190, 65, 65) and Skia would pass. Is the current reference color incorrect? Is Skia computing the gradient incorrectly? I took a look at the canvas spec and didn't see anything that clarified this issue.
This seems to have been fixed by the skia roll 4647-4683, most likely by Riley's linear gradient change in https://code.google.com/p/skia/source/detail?r=4680.
Reopening to attach new patch.
Created attachment 160972 [details] Patch
It turns out that this was not really fixed. In the range of the Skia roll where this started passing TomH made a changesto the shader generator which inadvertently broke the gpu-based unpremul<->premul conversions. We fell back to SW conversions and went back to barely passing the test because the conversions come out slightly different. The next Skia roll fixes the gpu-based conversions and so this test (along with canvas-fillPath-shadow.html which was also removed in r123297) will fail once again. The attached patch reverts the removal of these tests from TE.
Comment on attachment 160972 [details] Patch Darn. r=me
Comment on attachment 160972 [details] Patch I held off on c? so that it wouldn't hit before the skia roll makes it to WK DEPS (and get reverted due to unexpected pass) but that has happened. So I think this is good to go.
Comment on attachment 160972 [details] Patch Rejecting attachment 160972 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1 ERROR: /mnt/git/webkit-commit-queue/LayoutTests/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive). Full output: http://queues.webkit.org/results/13685753
Created attachment 161517 [details] Patch
Comment on attachment 161517 [details] Patch I messed up the Reviewed By line in the original patch. :(
Created attachment 163164 [details] Patch
Comment on attachment 163164 [details] Patch OK, bots willing. r=me.
Comment on attachment 163164 [details] Patch Rejecting attachment 163164 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: ): Merge conflict in LayoutTests/ChangeLog Failed to merge in the changes. Patch failed at 0001 Javascript in foreground tabs should not wait synchronously for plug-ins to load When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort". rebase refs/remotes/origin/master: command returned error: 1 Died at Tools/Scripts/update-webkit line 164. Full output: http://queues.webkit.org/results/13810328