RESOLVED FIXED Bug 105437
Incorrect color space conversion for FEImage
https://bugs.webkit.org/show_bug.cgi?id=105437
Summary Incorrect color space conversion for FEImage
Florin Malita
Reported 2012-12-19 08:00:14 PST
Chromium issue: http://code.google.com/p/chromium/issues/detail?id=166154 The default color space for SVG filters is linearRGB (http://www.w3.org/TR/SVG/filters.html#FilterPrimitivesOverviewIntro), but FEImage always produces deviceRGB results without updating its result color space field to reflect that. Hence, the filter chain performs an incorrect linearRGB->deviceRGB conversion for FEImage colors. Patch to follow.
Attachments
Patch (1.69 MB, patch)
2012-12-19 14:14 PST, Florin Malita
no flags
Patch for landing (1.69 MB, patch)
2012-12-20 06:24 PST, Florin Malita
no flags
Florin Malita
Comment 1 2012-12-19 14:14:44 PST
Florin Malita
Comment 2 2012-12-19 14:15:33 PST
(In reply to comment #1) > Created an attachment (id=180224) [details] > Patch I've verified that the new pixel results are consistent with FF.
Stephen Chenney
Comment 3 2012-12-19 14:32:44 PST
Comment on attachment 180224 [details] Patch Wow, that explains why the CG results were different for so many images. I would R+ this with the nit about the goto, but of course I can't.
Stephen Chenney
Comment 4 2012-12-19 14:34:32 PST
Comment on attachment 180224 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180224&action=review > Source/WebCore/platform/graphics/filters/FilterEffect.cpp:460 > #endif Dammit, this was lost the first time through. Why oh why? You can avoid the goto by putting "else {" inside the if/end and then putting "}" inside the if/end below (there the goto target is now). We use this pattern elsewhere in the code and it is nicer.
Eric Seidel (no email)
Comment 5 2012-12-19 14:38:23 PST
The review tool badness continues.
Build Bot
Comment 6 2012-12-19 20:47:02 PST
Comment on attachment 180224 [details] Patch Attachment 180224 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/15405851 New failing tests: http/tests/security/data-url-inline.css.html
Dirk Schulze
Comment 7 2012-12-19 23:04:32 PST
Comment on attachment 180224 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180224&action=review r=me. But agree with schenney. >> Source/WebCore/platform/graphics/filters/FilterEffect.cpp:460 >> #endif > > Dammit, this was lost the first time through. Why oh why? > > You can avoid the goto by putting "else {" inside the if/end and then putting "}" inside the if/end below (there the goto target is now). We use this pattern elsewhere in the code and it is nicer. yes, please use else { or #else. Better the first one.
Florin Malita
Comment 8 2012-12-20 06:24:31 PST
Created attachment 180332 [details] Patch for landing
Florin Malita
Comment 9 2012-12-20 06:35:03 PST
Comment on attachment 180224 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180224&action=review >>> Source/WebCore/platform/graphics/filters/FilterEffect.cpp:460 >>> #endif >> >> Dammit, this was lost the first time through. Why oh why? >> >> You can avoid the goto by putting "else {" inside the if/end and then putting "}" inside the if/end below (there the goto target is now). We use this pattern elsewhere in the code and it is nicer. > > yes, please use else { or #else. Better the first one. Thanks, done. I guess this could be cleaned up even more by having a separate transformResultColorSpaceOpenCL() for that block, and then prefixing the transformColorSpace() call with a single ifdef-ed conditional: #if ENABLE(OPENCL) if (!transformResultColorSpaceOpenCL(dstColorSpace)) #endif asImageBuffer()->transformColorSpace(m_resultColorSpace, dstColorSpace); But I'm not set up for OpenCL builds and not quite comfortable with making this change blindly :)
WebKit Review Bot
Comment 10 2012-12-20 06:56:02 PST
Comment on attachment 180332 [details] Patch for landing Clearing flags on attachment: 180332 Committed r138250: <http://trac.webkit.org/changeset/138250>
WebKit Review Bot
Comment 11 2012-12-20 06:56:07 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.