Bug 236574

Summary: [GPU Process] CSSFilter should be created only at the painting time
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: Layout and RenderingAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, changseok, dino, esprehn+autocc, ews-watchlist, fmalita, fred.wang, glenn, gyuyoung.kim, kondapallykalyan, pdr, schenney, sergio, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 236573    
Attachments:
Description Flags
Patch
none
Patch
simon.fraser: review+, ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
none
Patch none

Description Said Abou-Hallawa 2022-02-13 16:21:21 PST
CSSFilter::create() is called twice: 

(1) while doing the layout and creating the page layers. This call is mainly for calculating the filter outsets which is used for layer clipping. In this case we do not have a GraphicsContext
(2) while painting in RenderLayerFilters::beginFilterEffect(). In this case we do have a GraphicsContext

Building whole filter chain just to calculate the filter outsets is wrong. Instead we can use the FilterOperation and SVGFilterPrimitiveStandardAttributes superclasses to get their outsets without having to build the FilterEffects.
Comment 1 Said Abou-Hallawa 2022-02-13 16:50:44 PST
Created attachment 451846 [details]
Patch
Comment 2 Said Abou-Hallawa 2022-02-13 21:04:46 PST
Created attachment 451858 [details]
Patch
Comment 3 Simon Fraser (smfr) 2022-02-14 13:16:06 PST
Comment on attachment 451858 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=451858&action=review

> Source/WebCore/rendering/RenderLayerFilters.h:77
> +    RenderingMode m_renderingMode;

Let's default-initialize this.
Comment 4 Radar WebKit Bug Importer 2022-02-20 16:22:17 PST
<rdar://problem/89210004>
Comment 5 Said Abou-Hallawa 2022-03-28 14:22:33 PDT
Created attachment 455955 [details]
Patch
Comment 6 Said Abou-Hallawa 2022-03-28 16:09:17 PDT
Created attachment 455965 [details]
Patch
Comment 7 Said Abou-Hallawa 2022-03-29 00:16:34 PDT
Created attachment 456001 [details]
Patch
Comment 8 Said Abou-Hallawa 2022-04-04 14:00:52 PDT
Created attachment 456626 [details]
Patch
Comment 9 EWS 2022-04-04 19:07:38 PDT
Committed r292364 (249229@main): <https://commits.webkit.org/249229@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 456626 [details].