Bug 226425 - Adopt BifurcatedGraphicsContext for backing store + display list RemoteLayerBackingStore
Summary: Adopt BifurcatedGraphicsContext for backing store + display list RemoteLayerB...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-29 15:21 PDT by Tim Horton
Modified: 2021-07-16 11:24 PDT (History)
4 users (show)

See Also:


Attachments
Patch (17.77 KB, patch)
2021-05-29 15:22 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (17.49 KB, patch)
2021-06-02 15:47 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (20.34 KB, patch)
2021-06-02 17:34 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (20.34 KB, patch)
2021-06-03 18:39 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (22.03 KB, patch)
2021-07-16 02:51 PDT, Tim Horton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2021-05-29 15:21:03 PDT
Adopt BifurcatedGraphicsContext for backing store + display list RemoteLayerBackingStore
Comment 1 Tim Horton 2021-05-29 15:22:36 PDT
Created attachment 430113 [details]
Patch
Comment 2 Tim Horton 2021-05-29 15:24:24 PDT
Comment on attachment 430113 [details]
Patch

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

Needs a bunch more ifdefs, too.

> Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h:60
> +    void ensureBackingStore(Type, WebCore::FloatSize, float scale, bool deepColor, bool isOpaque, bool includeDisplayList);

Should not be just a bool

> Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:298
> +    m_frontBuffer.imageBuffer->flushDrawingContextAsync();
> +
> +    m_frontBufferFlusher = m_frontBuffer.imageBuffer->createFlusher();

Need to make sure that it's OK to not flush the DL ImageBuffer.
Comment 3 Tim Horton 2021-06-02 15:47:47 PDT
Created attachment 430413 [details]
Patch
Comment 4 Tim Horton 2021-06-02 17:34:05 PDT
Created attachment 430424 [details]
Patch
Comment 5 Tim Horton 2021-06-03 18:39:57 PDT
Created attachment 430528 [details]
Patch
Comment 6 Sam Weinig 2021-06-04 08:38:24 PDT
Comment on attachment 430528 [details]
Patch

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

> Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h:60
> +    enum class IncludeDisplayList : bool { No, Yes };

This feels a bit confusing, since this includes the CGDisplayList not the WebCore DisplayList. 

I also think it would be useful to keep around the "only send the CGDisplayList" version for a bit if we can. I wonder if we can generalize this a bit to keep that around without adding too much overhead.
Comment 7 Sam Weinig 2021-06-04 08:38:50 PDT
Let's chat about this a bit.
Comment 8 Tim Horton 2021-06-04 12:31:29 PDT
(In reply to Sam Weinig from comment #6)
> Comment on attachment 430528 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=430528&action=review
> 
> > Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h:60
> > +    enum class IncludeDisplayList : bool { No, Yes };
> 
> This feels a bit confusing, since this includes the CGDisplayList not the
> WebCore DisplayList. 

... true.

> I also think it would be useful to keep around the "only send the
> CGDisplayList" version for a bit if we can. I wonder if we can generalize
> this a bit to keep that around without adding too much overhead.

We could, I don't even think it would be particularly high overhead. I will peek.
Comment 9 Sam Weinig 2021-06-04 16:14:51 PDT
Comment on attachment 430528 [details]
Patch

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

> Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h:123
>          RefPtr<WebCore::ImageBuffer> imageBuffer;
> +#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
> +        RefPtr<WebCore::ImageBuffer> displayListImageBuffer;
> +#endif

Ultimately, I think it would be beneficial if we could avoid this layer being aware of the two image buffers at all, but just having a single bifurcated ImageBuffer class and letting the interface take care of things. That way, if we need a different structure in the future this won't have to change (and all the other benefits that come with good abstractions).
Comment 10 Radar WebKit Bug Importer 2021-06-05 15:22:16 PDT
<rdar://problem/78911168>
Comment 11 Tim Horton 2021-07-16 02:51:27 PDT
Created attachment 433667 [details]
Patch
Comment 12 EWS 2021-07-16 11:24:43 PDT
Committed r279992 (239735@main): <https://commits.webkit.org/239735@main>

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