FEImage has already an std::variant named 'SourceImage' to represent variants of image. The Pattern needs a similar structure; see bug 232411. So the plan is replace FEImage::SourceImage with the new class. Then make bug 232411 uses it as well.
Created attachment 449719 [details] Patch
Created attachment 449720 [details] Patch
Created attachment 449722 [details] Patch
Comment on attachment 449722 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=449722&action=review > Source/WebCore/ChangeLog:8 > + Before the existence of GPUProces we used to make some drawing on an "GPUProcess" s/make some drawing/do some drawing/ > Source/WebCore/ChangeLog:10 > + NativeImage. With GPUProces, this will require bouncing the NativeImage "GPUProcess" > Source/WebCore/ChangeLog:11 > + between WebPorcess and GPUProcess at least two times. To make this scenario "WebProcess" > Source/WebCore/ChangeLog:12 > + efficient, a new class called SourceImage' will be introduced. The purpose Stray (or missing) apostrophe. > Source/WebCore/platform/graphics/SourceImage.cpp:74 > + auto imageBuffer = ImageBuffer::create(nativeImage->size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8); If canvas patterns will use this class, then they'll need a way to specify the color space when creating the ImageBuffer, so that we don't always convert to sRGB.
Created attachment 449728 [details] Patch
Committed r288412 (246303@main): <https://commits.webkit.org/246303@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 449728 [details].
<rdar://problem/87931919>