[webkit-reviews] review granted: [Bug 226108] Rename ImageBuffer::transformColorSpace to transformToColorSpace, and it should take a single argument : [Attachment 429625] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue May 25 22:17:08 PDT 2021
Said Abou-Hallawa <sabouhallawa at apple.com> has granted Fujii Hironori
<Hironori.Fujii at sony.com>'s request for review:
Bug 226108: Rename ImageBuffer::transformColorSpace to transformToColorSpace,
and it should take a single argument
https://bugs.webkit.org/show_bug.cgi?id=226108
Attachment 429625: Patch
https://bugs.webkit.org/attachment.cgi?id=429625&action=review
--- Comment #9 from Said Abou-Hallawa <sabouhallawa at apple.com> ---
Comment on attachment 429625
--> https://bugs.webkit.org/attachment.cgi?id=429625
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=429625&action=review
> Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp:82
> +#if USE(CG)
> + auto renderingColorSpace = colorSpace;
> +#else
> + auto renderingColorSpace = DestinationColorSpace::SRGB();
> +#endif
I think combining the calculation of colorSpace and renderingColorSpace might
be more clear. I would suggest something like this:
auto maskColorSpace = DestinationColorSpace::SRGB();
auto drawColorSpace = DestinationColorSpace::SRGB();
#if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
if (svgStyle.colorInterpolation() == ColorInterpolation::LinearRGB) {
#if USE(CG)
maskColorSpace = DestinationColorSpace::LinearSRGB();
#endif
drawColorSpace = DestinationColorSpace::LinearSRGB();
}
#endif
So this code is saying the default colorSpace for the mask and the drawing is
SRGB. The exception happens if svgStyle.colorInterpolation is LinearRGB. In
this case, the drawing colorSpace will be LinearSRGB. And the CG ports will
have an exception also. The mask image will be created with LinearSRGB
colorSpace.
More information about the webkit-reviews
mailing list