Bug 232840 - [GPU Process] [Filters 18/23] Remove the result FilterImage from FilterEffect
Summary: [GPU Process] [Filters 18/23] Remove the result FilterImage from FilterEffect
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: 231253
  Show dependency treegraph
 
Reported: 2021-11-08 13:09 PST by Said Abou-Hallawa
Modified: 2022-01-07 14:22 PST (History)
19 users (show)

See Also:


Attachments
Patch (45.89 KB, patch)
2022-01-04 04:12 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (46.54 KB, patch)
2022-01-04 09:38 PST, Said Abou-Hallawa
darin: review+
Details | Formatted Diff | Diff
Patch (47.98 KB, patch)
2022-01-07 09:46 PST, Said Abou-Hallawa
no flags 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 2021-11-08 13:09:42 PST
A FilterEffect should be applied to any input FilterImages and results a FilterImage. These FilterImages will managed by the Filter class and should be cached by the creator of the source ImageBuffer. In the case of the GPU Process, they will be cached by RemoteResourceCache.
Comment 1 Radar WebKit Bug Importer 2021-11-15 13:11:00 PST
<rdar://problem/85425842>
Comment 2 Said Abou-Hallawa 2022-01-04 04:12:42 PST
Created attachment 448280 [details]
Patch
Comment 3 Said Abou-Hallawa 2022-01-04 09:38:37 PST
Created attachment 448302 [details]
Patch
Comment 4 Darin Adler 2022-01-04 21:48:21 PST
Comment on attachment 448302 [details]
Patch

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

> Source/WebCore/platform/graphics/filters/FilterResults.cpp:40
> +    for (auto input : inputs) {

Using "auto" here means we copy each Ref<FilterImage>. I think that instead we should use "auto&" and save a bit of reference count churn.

> Source/WebCore/platform/graphics/filters/FilterResults.cpp:46
> +        auto addResult = m_resultReferences.ensure(input, [] {
> +            return FilterEffectSet();
> +        });
> +
> +        auto& references = addResult.iterator->value;
> +        references.add(effect);

This can just use add, because FilterEffectSet() is a null pointer, very cheap to construct and destruct. Can write this as a one-liner.

    m_resultReferences.add(input, { }).iterator->value.add(effect);

> Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h:52
> +    void appendEffectToEffectRenderer(FilterEffect*, RenderObject*);

This should take a FilterEffect& instead of a FilterEffect*.
Comment 5 Said Abou-Hallawa 2022-01-07 09:46:49 PST
Created attachment 448605 [details]
Patch
Comment 6 EWS 2022-01-07 14:22:16 PST
Committed r287782 (245842@main): <https://commits.webkit.org/245842@main>

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