This will allow applying a GraphicsStyle to all the following drawing commands. Some of FilterEffects can be expressed as GraphicsStyles. Applying a FilterEffect using CoreGraphics will be done by setting GraphicsStyle to the GraphicsContext before drawing the sourceImage of the Filter. The plan is control beginning, ending and nesting GraphicsStyle using transparency layers.
<rdar://problem/102591759>
Pull request: https://github.com/WebKit/WebKit/pull/6718
Created attachment 463646 [details] Patch
Created attachment 463648 [details] Patch
Created attachment 463653 [details] Patch
Comment on attachment 463653 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=463653&action=review I suggest you add DropShadow first, then add support for gaussian blur and color matrix. > Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h:193 > +struct CGGaussianBlurStyle { These need to be wrapped in #if HAVE(CGSTYLE_COLORMATRIX_BLUR) > Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h:210 > + kCGStyleGaussianBlur = 3, The new values need to be wrapped in HAVE(CGSTYLE_COLORMATRIX_BLUR) > Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h:367 > +CGStyleRef CGStyleCreateGaussianBlur(const CGGaussianBlurStyle*); These need to be wrapped in HAVE(CGSTYLE_COLORMATRIX_BLUR)
Comment on attachment 463653 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=463653&action=review >> Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h:193 >> +struct CGGaussianBlurStyle { > > These need to be wrapped in #if HAVE(CGSTYLE_COLORMATRIX_BLUR) Done. >> Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h:210 >> + kCGStyleGaussianBlur = 3, > > The new values need to be wrapped in HAVE(CGSTYLE_COLORMATRIX_BLUR) Done. >> Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h:367 >> +CGStyleRef CGStyleCreateGaussianBlur(const CGGaussianBlurStyle*); > > These need to be wrapped in HAVE(CGSTYLE_COLORMATRIX_BLUR) CGStyleCreateShadow2() is not supported on GoldenGate https://ews-build.webkit.org/#/builders/43/builds/30382. So I think we should enable all the CoreGraphics by a single flag: HAVE(CORE_GRAPHICS_STYLES) or HAVE(CG_STYLES).
A new PR was uploaded to https://github.com/WebKit/WebKit/pull/6718
Committed 256980@main (d6bd013ec6ba): <https://commits.webkit.org/256980@main> Reviewed commits have been landed. Closing PR #6718 and removing active labels.