.
<rdar://problem/83752451>
We draw the SVG image into a NativeImage so it can be sent to the GPU process.
Created attachment 439822 [details] Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment on attachment 439822 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439822&action=review > Source/WebCore/platform/graphics/GraphicsContext.h:433 > + virtual ImageDrawResult drawImageForCanvas(Image&, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions&, DestinationColorSpace canvasColorSpace); Not a fan of "for canvas" down here in GraphicsContext. Can we just an std::optional<DestinationColorSpace> to an existing function? > Source/WebCore/svg/graphics/SVGImage.h:102 > + ImageDrawResult drawForCanvas(GraphicsContext&, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions&, DestinationColorSpace) final; > + ImageDrawResult drawAsNativeImage(GraphicsContext&, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions&, DestinationColorSpace); > ImageDrawResult drawForContainer(GraphicsContext&, const FloatSize containerSize, float containerZoom, const URL& initialFragmentURL, const FloatRect& dstRect, const FloatRect& srcRect, const ImagePaintingOptions& = { }); > + ImageDrawResult drawForContainerInternal(GraphicsContext&, const FloatSize containerSize, float containerZoom, const URL& initialFragmentURL, const FloatRect& dstRect, const FloatRect& srcRect, const ImagePaintingOptions&, DestinationColorSpace); > + ImageDrawResult drawInternal(GraphicsContext&, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions&, DestinationColorSpace); > + ImageDrawResult drawForCanvasForContainer(GraphicsContext&, const FloatSize containerSize, float containerZoom, const URL& initialFragmentURL, const FloatRect& dstRect, const FloatRect& srcRect, const ImagePaintingOptions&, DestinationColorSpace); That's quite a bit of proliferation too. Can std::optional<DestinationColorSpace> help?
(In reply to Simon Fraser (smfr) from comment #5) > Can we just an std::optional<DestinationColorSpace> to an existing function? That was my first thought. There were many subclasses to add that to. Maybe that's better than adding the separate functions here.
Created attachment 439920 [details] Patch with Image::draw / GraphicsContext::drawImage argument
There's a version of the patch with a std::optional<DestinationColorSpace> argument. And I could be convinced not to make it optional (or std::optional<>) so that all drawImage/draw callers have to pass in an intermediate color space.
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/31108
Created attachment 440139 [details] Patch
Committed r283531 (242497@main): <https://commits.webkit.org/242497@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 440139 [details].