[webkit-changes] [WebKit/WebKit] cfa812: Regression(251234 at main): [Cairo][GTK][WPE] Darker ...
Przemyslaw Gorszkowski
noreply at github.com
Wed Feb 21 04:23:19 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cfa8125ddf7c39a7256fcddf52b3c9f35de026e3
https://github.com/WebKit/WebKit/commit/cfa8125ddf7c39a7256fcddf52b3c9f35de026e3
Author: Przemyslaw Gorszkowski <pgorszkowski at igalia.com>
Date: 2024-02-21 (Wed, 21 Feb 2024)
Changed paths:
M LayoutTests/TestExpectations
M LayoutTests/fast/gradients/conic-gradient-extended-stops.html
M LayoutTests/platform/glib/TestExpectations
M LayoutTests/svg/filters/feConvolveMatrix-clipped.svg
M LayoutTests/svg/filters/feGaussianBlur-clipped.svg
M Source/WTF/wtf/PlatformEnable.h
M Source/WebCore/platform/graphics/ImageBuffer.cpp
M Source/WebCore/platform/graphics/filters/FEDropShadow.h
M Source/WebCore/platform/graphics/filters/FilterImageTargetSwitcher.cpp
M Source/WebCore/platform/graphics/filters/FilterImageTargetSwitcher.h
M Source/WebCore/platform/graphics/filters/FilterStyleTargetSwitcher.cpp
M Source/WebCore/platform/graphics/filters/FilterStyleTargetSwitcher.h
M Source/WebCore/platform/graphics/filters/FilterTargetSwitcher.h
M Source/WebCore/rendering/RenderLayerFilters.cpp
M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceFilter.cpp
M Source/WebCore/svg/graphics/filters/SVGFilter.cpp
Log Message:
-----------
Regression(251234 at main): [Cairo][GTK][WPE] Darker output of SVG with filters fediffuselighting
https://bugs.webkit.org/show_bug.cgi?id=268537
Reviewed by Said Abou-Hallawa and Nikolas Zimmermann.
Turn off the support for linearRGB color space in case of Cairo (251234 at main) causes, that SVG
with filter, where linearRGB as inputs is demanded, generates darker output.
The SVG spec says that SourceGraphic has to be in linearRGB color space:
https://www.w3.org/TR/filter-effects-1/#attr-valuedef-in-sourcegraphic
In case of Cairo (which operates in SRGB color space) the image source (SourceGraphic)
should be created in SRGB and before passing it to filters, it should be transformed to
linearRGB color space.
* LayoutTests/TestExpectations:
* LayoutTests/platform/glib/TestExpectations:
Remove some tests which pass with this change
* LayoutTests/svg/filters/feConvolveMatrix-clipped.svg:
* LayoutTests/svg/filters/feGaussianBlur-clipped.svg:
* LayoutTests/fast/gradients/conic-gradient-extended-stops.html:
Add possible differences in outputs
* Source/WebCore/platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::filteredNativeImage):
Pass color space to endDrawSourceImage
* Source/WebCore/platform/graphics/filters/FEDropShadow.h:
Force to use SRGB as operating color space for DropShadow in case of Cairo.
* Source/WebCore/platform/graphics/filters/FilterImageTargetSwitcher.cpp:
(WebCore::FilterImageTargetSwitcher::endClipAndDrawSourceImage):
(WebCore::FilterImageTargetSwitcher::endDrawSourceImage):
Before applying all filter, the source image has to be translated to requested
color space (only valid for Cairo).
* Source/WebCore/platform/graphics/filters/FilterTargetSwitcher.h:
* Source/WebCore/platform/graphics/filters/FilterImageTargetSwitcher.h:
* Source/WebCore/platform/graphics/filters/FilterStyleTargetSwitcher.h:
Added color space as additional parameter.
* Source/WebCore/platform/graphics/filters/FilterStyleTargetSwitcher.cpp:
(WebCore::FilterStyleTargetSwitcher::endDrawSourceImage):
WebCore::FilterStyleTargetSwitcher::endDrawSourceImage does not use color space so just ignore it
* Source/WebCore/rendering/RenderLayerFilters.cpp:
(WebCore::RenderLayerFilters::applyFilterEffect):
Just pass DestinationColorSpace::SRGB() to endClipAndDrawSourceImage.
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceFilter.cpp:
(WebCore::LegacyRenderSVGResourceFilter::applyResource):
In case of Cairo, the sourceImage has to be created with sRGB color space, because
Cairo operates in sRGB. The linearRGB color space will be passed to TargetSwitcher
in WebCore::LegacyRenderSVGResourceFilter::postApplyResource and the sourceImage will
be transformed to linearRGB before all filter applying.
(WebCore::LegacyRenderSVGResourceFilter::postApplyResource):
Before applying all filter, the source image has to be translated to requested
color space.
* Source/WebCore/svg/graphics/filters/SVGFilter.cpp:
(WebCore::buildFilterEffectsGraph):
Create SourceGraphic and SourceAlpha with LinearRGB color space if
color-interpolation_filter attribute of the Filter has LinearRGB value (only in case of Cairo).
Canonical link: https://commits.webkit.org/275091@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list