Bug 248197 - [Filters] Introduce GraphicsStyle and add it to GraphicsContext and GraphicsContextState
Summary: [Filters] Introduce GraphicsStyle and add it to GraphicsContext and GraphicsC...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks: 243816
  Show dependency treegraph
 
Reported: 2022-11-21 17:23 PST by Said Abou-Hallawa
Modified: 2022-11-23 17:24 PST (History)
10 users (show)

See Also:


Attachments
Patch (29.60 KB, patch)
2022-11-21 17:38 PST, Said Abou-Hallawa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (29.67 KB, patch)
2022-11-21 18:21 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (29.57 KB, patch)
2022-11-21 20:33 PST, Said Abou-Hallawa
simon.fraser: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2022-11-21 17:23:58 PST
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.
Comment 1 Radar WebKit Bug Importer 2022-11-21 17:32:04 PST
<rdar://problem/102591759>
Comment 2 Said Abou-Hallawa 2022-11-21 17:36:50 PST
Pull request: https://github.com/WebKit/WebKit/pull/6718
Comment 3 Said Abou-Hallawa 2022-11-21 17:38:44 PST
Created attachment 463646 [details]
Patch
Comment 4 Said Abou-Hallawa 2022-11-21 18:21:47 PST
Created attachment 463648 [details]
Patch
Comment 5 Said Abou-Hallawa 2022-11-21 20:33:26 PST
Created attachment 463653 [details]
Patch
Comment 6 Simon Fraser (smfr) 2022-11-22 09:37:57 PST
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 7 Said Abou-Hallawa 2022-11-22 14:20:52 PST
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).
Comment 8 Said Abou-Hallawa 2022-11-22 14:21:34 PST
A new PR was uploaded to https://github.com/WebKit/WebKit/pull/6718
Comment 9 EWS 2022-11-23 17:24:27 PST
Committed 256980@main (d6bd013ec6ba): <https://commits.webkit.org/256980@main>

Reviewed commits have been landed. Closing PR #6718 and removing active labels.