feImage as filter input has skewed colors
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Nov 2017 02:19:53 +0000 (02:19 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Nov 2017 02:19:53 +0000 (02:19 +0000)
commita0e96c5ab64bac721e80e084c8c27577f75ecf5a
tree52986b96cdcecfe60778f842deaa50f8afbcb6d7
parentade7566bab9cf03a31799ad4fb83b72e102abec9
feImage as filter input has skewed colors
https://bugs.webkit.org/show_bug.cgi?id=180021

Reviewed by Sam Weinig.
Source/WebCore:

Using an <feImage> as a filter input sometimes results in incorrect colors, because
the image is being sourced as linearRGB when it should always be sRGB.

Fix by setting the result colorspace in FEImage before we allocate the output
buffer.

Tests: svg/filters/feImage-color-fidelity-expected.svg
       svg/filters/feImage-color-fidelity.svg

* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::platformApplySoftware):

LayoutTests:

* svg/filters/feImage-color-fidelity-expected.svg: Added.
* svg/filters/feImage-color-fidelity.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/svg/filters/feImage-color-fidelity-expected.svg [new file with mode: 0644]
LayoutTests/svg/filters/feImage-color-fidelity.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/graphics/filters/SVGFEImage.cpp