[webkit-changes] [WebKit/WebKit] dcb5bd: When waitingForBackingStoreSwap and an updateRende...
Gerald Squelart
noreply at github.com
Wed Jun 28 22:08:41 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: dcb5bdf28a06089bd20da9444effac52e88384f8
https://github.com/WebKit/WebKit/commit/dcb5bdf28a06089bd20da9444effac52e88384f8
Author: Gerald Squelart <g_squelart at apple.com>
Date: 2023-06-28 (Wed, 28 Jun 2023)
Changed paths:
M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm
M Tools/TestWebKitAPI/Tests/ios/ApplicationStateTracking.mm
Log Message:
-----------
When waitingForBackingStoreSwap and an updateRendering is pending, don't CommitLayerTreeNotTriggered but set m_deferredRenderingUpdateWhileWaitingForBackingStoreSwap
https://bugs.webkit.org/show_bug.cgi?id=258391
rdar://110536156
Reviewed by Simon Fraser.
In some situations there may be a race between `displayDidRefresh` and `updateRendering`, such that `displayDidRefresh` runs first, sees no updates, and sends `commitLayerTreeNotTriggered` to the UI process, which will pause further refresh callbacks; in the test at fault, this meant `synchronouslyLoadHTMLString` would never return.
In contrast, the test would succeed when `updateRendering` happened first, which would notice that something was waiting for an update (`m_waitingForBackingStoreSwap` being true), and setting `m_deferredRenderingUpdateWhileWaitingForBackingStoreSwap` to prevent the subsequent `displayDidRefresh` from pausing refresh callbacks.
So to remedy the bad situation, when `displayDidRefresh` would normally send `commitLayerTreeNotTriggered`, it first checks if `m_deferredRenderingUpdateWhileWaitingForBackingStoreSwap` is true AND if there is a pending `updateRendering`, in which case instead it mimics what an race-winning `updateRendering` would have done, and sets `m_deferredRenderingUpdateWhileWaitingForBackingStoreSwap`.
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::displayDidRefresh):
* Tools/TestWebKitAPI/Tests/ios/ApplicationStateTracking.mm:
(TestWebKitAPI::TEST):
Canonical link: https://commits.webkit.org/265611@main
More information about the webkit-changes
mailing list