Bug 257005

Summary: The first RemoteLayerTreeDrawingAreaProxy::commitLayerTree after being idle is always considered 'missed'.
Product: WebKit Reporter: Matt Woodrow <mattwoodrow>
Component: Layout and RenderingAssignee: Matt Woodrow <mattwoodrow>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, simon.fraser, thorton, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Matt Woodrow 2023-05-18 18:59:53 PDT
Each RemoteLayerTreeDrawingAreaProxy::commitLayerTree IPC messages results in a reply displayDidRefresh message being sent back to the WebProcess (once the display link fires) to trigger the next rendering update.

If the next commitLayerTree isn't received before the following display link callback, it goes into a 'missed commit' state, assuming the rendering update took more than one interval to render. In missed commit state, when the commitLayerTree eventually arrives, the displayDidRefresh reply is sent immediately, rather than waiting for the next display link callback.

This can't differentiate between a slow rendering update, and an idle WebContent process that decided it didn't need to do a rendering update at all. When we do resume from idle, we'll always be in missed commit state, and do a second rendering update (attempt) immediately, for no real benefit.
Comment 1 Radar WebKit Bug Importer 2023-05-18 19:00:14 PDT
<rdar://problem/109543927>
Comment 2 Matt Woodrow 2023-05-18 19:02:55 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14054
Comment 3 Matt Woodrow 2023-05-22 21:37:38 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14228
Comment 4 EWS 2023-05-25 14:17:13 PDT
Committed 264538@main (7f170efe52d7): <https://commits.webkit.org/264538@main>

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