[Webkit-unassigned] [Bug 77550] New: [CHROMIUM/SKIA] canvas/philip/tests/2d.gradient.interpolate.colouralpha.html fails in GPU

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 1 06:45:38 PST 2012


           Summary: [CHROMIUM/SKIA]
                    a.html fails in GPU
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Canvas
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: bsalomon at google.com
                CC: reed at google.com, senorblanco at chromium.org,
                    mdelaney at apple.com

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.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list