Bug 256535 - [GPU Process][Filters] Top level SVGFilter should own its FilterResults
Summary: [GPU Process][Filters] Top level SVGFilter should own its FilterResults
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: 232845
  Show dependency treegraph
 
Reported: 2023-05-09 11:18 PDT by Said Abou-Hallawa
Modified: 2023-05-11 18:50 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2023-05-09 11:18:37 PDT
This will allow caching the FilterResults along with the SVGFilter in RemoteResourceCache. The solution has to consider the following cases for the SVGFilter & FilterResults:

a. SVGFilter is created in WebProcess:
    1. Rendering in WebProcess:
        i. Top level SVGFilter: SVGFilter creates its FilterResults. SVGFilter caches its FilterResults (will be implemented by this bug).
       ii. Referenced SVGFilter: SVGFilter should not create FilterResults.
    2. Rendering in GPUProcess:
        i. Top level SVGFilter: SVGFilter should not create FilterResults (will be fixed by this bug).
       ii. Referenced SVGFilter: SVGFilter should not create FilterResults.
b. SVGFilter is created in GPUProcess:
    1. Rendering in GPUProcess:
        i. Top level SVGFilter: SVGFilter creates its FilterResults (Memory has to be attributed to WebProcess). SVGFilter caches its FilterResults (will be implemented in another bug).
       ii. Referenced SVGFilter: SVGFilter should not create FilterResults.

To do that GraphicsContext::drawFilteredImageBuffer() has to take FilterResultsEnsurer which returns FilterResults&. drawFilteredImageBuffer() will call it only when the FilterResults is needed.  SVGFilter::ensureResults() will return FilterResults& and it takes FilterResultsCreator. FilterResultsCreator will return a std::unique_ptr<FilterResults> which SVGFilter will maintain.
Comment 1 Radar WebKit Bug Importer 2023-05-09 11:19:25 PDT
<rdar://problem/109107572>
Comment 2 Said Abou-Hallawa 2023-05-09 11:45:30 PDT
Pull request: https://github.com/apple/WebKit/pull/587
Comment 3 Said Abou-Hallawa 2023-05-09 13:46:42 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13652
Comment 4 Said Abou-Hallawa 2023-05-09 18:22:20 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13676
Comment 5 EWS 2023-05-11 18:50:44 PDT
Committed 263996@main (b860110f0ae4): <https://commits.webkit.org/263996@main>

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