Bug 235073 - [GPU Process] [SVG Resources] Make SVG resources create remote ImageBuffers for their drawing
Summary: [GPU Process] [SVG Resources] Make SVG resources create remote ImageBuffers f...
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: 234165
  Show dependency treegraph
 
Reported: 2022-01-11 09:13 PST by Said Abou-Hallawa
Modified: 2022-01-11 23:50 PST (History)
16 users (show)

See Also:


Attachments
Patch (14.96 KB, patch)
2022-01-11 09:20 PST, Said Abou-Hallawa
darin: review+
Details | Formatted Diff | Diff
Patch (21.56 KB, patch)
2022-01-11 21:49 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 2022-01-11 09:13:50 PST
This will force the SVG resources (i.e. clippers, masks, patterns and gradients) to apply their drawing in the GPU Process. The filters are tracked by bug 231253. We still need to optimize the usage of these ImageBuffers, like not getting a NativeImage from the remote ImageBuffer in WebProcess and then draw the NativeImage to another remote ImageBuffer.
Comment 1 Radar WebKit Bug Importer 2022-01-11 09:15:35 PST
<rdar://problem/87402419>
Comment 2 Said Abou-Hallawa 2022-01-11 09:20:42 PST
Created attachment 448852 [details]
Patch
Comment 3 Darin Adler 2022-01-11 09:47:08 PST
Comment on attachment 448852 [details]
Patch

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

> Source/WebCore/ChangeLog:3
> +        [GPU Process] Make SVG resources create remote ImageBuffers for their drawing

Is there a way to test that this has the desired result?

> Source/WebKit/GPUProcess/graphics/QualifiedResourceHeap.h:164
> +        if (!std::holds_alternative<Ref<T>>(iterator->value))
> +            return nullptr;
>          return std::get<Ref<T>>(iterator->value).ptr();

Would be nice to use get_if instead of calling holds_alternative and then get. Would reduce reference count churn, and code would be less repetitive:

    auto value = std::get_if<Ref<T>>(&iterator->value);
    return value ? value->ptr() : nullptr;
Comment 4 Said Abou-Hallawa 2022-01-11 21:49:00 PST
Created attachment 448906 [details]
Patch
Comment 5 Said Abou-Hallawa 2022-01-11 22:12:47 PST
Comment on attachment 448852 [details]
Patch

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

>> Source/WebCore/ChangeLog:3
>> +        [GPU Process] Make SVG resources create remote ImageBuffers for their drawing
> 
> Is there a way to test that this has the desired result?

This change fixed some of the layout tests when running them with "--use-gpu-process". I un-skipped them from LayoutTests/gpu-process/TestExpectations

>> Source/WebKit/GPUProcess/graphics/QualifiedResourceHeap.h:164
>>          return std::get<Ref<T>>(iterator->value).ptr();
> 
> Would be nice to use get_if instead of calling holds_alternative and then get. Would reduce reference count churn, and code would be less repetitive:
> 
>     auto value = std::get_if<Ref<T>>(&iterator->value);
>     return value ? value->ptr() : nullptr;

Fixed.
Comment 6 EWS 2022-01-11 23:50:33 PST
Committed r287911 (245944@main): <https://commits.webkit.org/245944@main>

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