Bug 257290 - Multiple RemoteLayerTreeDrawingAreas should not be driven from a single display refresh monitor
Summary: Multiple RemoteLayerTreeDrawingAreas should not be driven from a single displ...
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: Matt Woodrow
URL:
Keywords: InRadar
Depends on:
Blocks: 258391
  Show dependency treegraph
 
Reported: 2023-05-24 15:45 PDT by Matt Woodrow
Modified: 2023-06-22 01:40 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Woodrow 2023-05-24 15:45:43 PDT
RemoteLayerTreeDisplayRefreshMonitor is mostly just a wrapper around asking the RemoteLayerTreeDrawingArea to schedule when it wants to display next. This is specific to that drawing area, and can be throttled if the drawing area is failing to commit layer trees as fast as expected.

DisplayRefreshMonitorManager caches DisplayRefreshMonitors, and shares them between all WebCore::Page/RenderingUpdateSchedulers on the same Display. This means if we have multiple RemoteLayerTreeDrawingAreas on the same display (and in the same process), we'll be sharing a single RemoteLayerTreeDisplayRefreshMonitor, driven at the effective rate of one of the drawing areas.

It looks like DrawingAreaCoordinatedGraphics has the same problem, and synthesises a unique DisplayID for each DrawingArea to ensure a unique display refresh monitor for each -  https://searchfox.org/wubkat/rev/dab28312bc80bc475196b7d6221b060347254e33/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp#565-569

I think RenderingUpdateScheduler as a DisplayRefreshMonitorClient isn't the right abstraction for what behaviour we want.

I think we should make WebCore::Page ask the ChromeClient/DrawingArea more directly to schedule the next rendering update, and DrawingArea implementations can choose to use DisplayRefreshMonitor to implement this if they choose. RemoteLayerTreeDrawingArea can just use its internal IPC-based scheduling, and we shouldn't need RemoteLayerTreeDisplayRefreshMonitor.
Comment 1 Matt Woodrow 2023-05-24 22:40:15 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14327
Comment 2 Radar WebKit Bug Importer 2023-05-28 15:18:49 PDT
<rdar://problem/109953504>
Comment 3 EWS 2023-06-06 19:18:45 PDT
Committed 264920@main (fa67a2625225): <https://commits.webkit.org/264920@main>

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