[Webkit-unassigned] [Bug 43102] New: Set incorrect but close expectations for mask-colorspace.svg on mac

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 27 19:37:19 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=43102

           Summary: Set incorrect but close expectations for
                    mask-colorspace.svg on mac
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: SVG
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: anicolao at chromium.org
                CC: zimmermann at kde.org, ojan at chromium.org


The correct colours for the mask-colorspace.svg test are (111,111,111) and (78,78,78). On Mac, when CoreGraphics converts the mask image from sRGB to Linear, the values that come back in WebCore/platform/graphics/cg/ImageBufferCG.cpp don't match my expectations. Specifically, around line 171:

    for (int y = 0; y < numRows; ++y) {
        for (int x = 0; x < numColumns; x++) {
            int basex = x * 4;
            unsigned char alpha = srcRows[basex + 3];
            if (multiplied == Unmultiplied && alpha) {
                destRows[basex] = (srcRows[basex] * 255) / alpha;
                destRows[basex + 1] = (srcRows[basex + 1] * 255) / alpha;  // **** Green channel set to 211
                destRows[basex + 2] = (srcRows[basex + 2] * 255) / alpha;
                destRows[basex + 3] = alpha;
            } else
                reinterpret_cast<uint32_t*>(destRows + basex)[0] = reinterpret_cast<uint32_t*>(srcRows + basex)[0];
        }


The green channel is set to 211 instead of 202 (where 202 is expected because =255*(((round(0.9*255)/255 + 0.055)/1.055)^2.4) = 201.78, and this is how the SVG specification indicates RGB should be converted to Linear RGB as per http://www.w3.org/TR/SVG/painting.html#RenderingProperties). This can be easily verified with a comment on the line indicated as the first pixel of the mask should be 0,202,0 and so when the breakpoint is hit the 0,211,0 can be verified while viewing the mask-colorspace.svg file.

The closest documentation I can find on what CoreGraphics does in this case is here: http://developer.apple.com/mac/library/documentation/GraphicsImaging/Reference/CGColorSpace/Reference/reference.html#//apple_ref/doc/uid/TP30000949-CH3g-BBCHAECC where it says that Linear is a matter of converting from sRGB to RGB with a gamma of 1.0. I don't think this is correct/matches the SVG spec, but I am not sure of it, would be happy to be enlightened.

The expectation provided in the patch attached is the current behaviour which is pretty close to the desired pixel output (something like 104-gray on the outside and 74 or 75 on the inside). So I think it's worth recording and will make a new bug to note that the behaviour is not actually correct.

-- 
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