Skip to content

Conversation

@smfr
Copy link
Contributor

@smfr smfr commented Dec 21, 2022

9f0c7ac

Generalize willStartPlatformRenderingUpdate/didCompleteRenderingUpdateDisplay() and call for all configurations
https://bugs.webkit.org/show_bug.cgi?id=249750
rdar://103614410

Reviewed by Tim Horton.

Add functions to WebPage and Page that get called before and after the "commit layer tree and paint" part
of a rendering update. In TiledCoreAnimationDrawingArea and WebKitLegacy which use Core Animation rendering,
this time period equates to the start and end of the CA commit. In RemoteLayerTreeDrawingArea, it starts
when we build the layer tree transaction, and ends when the buffer flushing is complete.

Web inspector uses these hooks to build its "commit" timeline events. Previously, these events were
broken on iOS because RemoteLayerTreeDrawingArea erroneously used CA commit handlers in an environment
where there is no real CA commit (webkit.org/b/249736). And in WebKitLegacy, we'll now also correctly
generate these events. Now there is only one call site for inspector composite hooks.

* Source/WebCore/page/Page.cpp:
(WebCore::Page::willStartRenderingUpdateDisplay):
(WebCore::Page::didCompleteRenderingUpdateDisplay):
(WebCore::Page::willStartPlatformRenderingUpdate): Deleted.
(WebCore::Page::didCompletePlatformRenderingUpdate): Deleted.
* Source/WebCore/page/Page.h:
* Source/WebKit/WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::willStartRenderingUpdateDisplay):
(WebKit::DrawingArea::didCompleteRenderingUpdateDisplay):
* Source/WebKit/WebProcess/WebPage/DrawingArea.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateRendering):
(WebKit::RemoteLayerTreeDrawingArea::didCompleteRenderingUpdateDisplay):
(WebKit::RemoteLayerTreeDrawingArea::addCommitHandlers): Deleted.
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willStartRenderingUpdateDisplay):
(WebKit::WebPage::didCompleteRenderingUpdateDisplay):
(WebKit::WebPage::willStartPlatformRenderingUpdate): Deleted.
(WebKit::WebPage::didCompletePlatformRenderingUpdate): Deleted.
* Source/WebKit/WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::firstFlushAfterCommit const): Deleted.
(WebKit::WebPage::setFirstFlushAfterCommit): Deleted.
* Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedPaintingMilestones):
(WebKit::TiledCoreAnimationDrawingArea::didCompleteRenderingUpdateDisplay):
(WebKit::TiledCoreAnimationDrawingArea::addCommitHandlers):
* Source/WebKitLegacy/mac/WebView/WebView.mm:
(-[WebView _willStartRenderingUpdateDisplay]):
(-[WebView _didCompleteRenderingUpdateDisplay]):
(LayerFlushController::flushLayers):
* Source/WebKitLegacy/mac/WebView/WebViewData.h:
(LayerFlushController::didCompleteRenderingUpdateDisplay):

Canonical link: https://commits.webkit.org/258248@main

b024fce

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 🧪 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🛠 gtk ✅ 🛠 wincairo
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 gtk-wk2
✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🧪 api-gtk
✅ 🛠 tv ✅ 🧪 mac-wk2
✅ 🛠 tv-sim ✅ 🧪 mac-AS-debug-wk2
✅ 🛠 watch ✅ 🧪 mac-wk2-stress
✅ 🛠 🧪 merge ✅ 🛠 watch-sim

@smfr smfr requested a review from cdumez as a code owner December 21, 2022 22:53
@smfr smfr self-assigned this Dec 21, 2022
@smfr smfr added the WebKit Process Model Bugs related to WebKit's multi-process architecture label Dec 21, 2022
@smfr smfr added the merge-queue Applied to send a pull request to merge-queue label Dec 22, 2022
…eDisplay() and call for all configurations

https://bugs.webkit.org/show_bug.cgi?id=249750
rdar://103614410

Reviewed by Tim Horton.

Add functions to WebPage and Page that get called before and after the "commit layer tree and paint" part
of a rendering update. In TiledCoreAnimationDrawingArea and WebKitLegacy which use Core Animation rendering,
this time period equates to the start and end of the CA commit. In RemoteLayerTreeDrawingArea, it starts
when we build the layer tree transaction, and ends when the buffer flushing is complete.

Web inspector uses these hooks to build its "commit" timeline events. Previously, these events were
broken on iOS because RemoteLayerTreeDrawingArea erroneously used CA commit handlers in an environment
where there is no real CA commit (webkit.org/b/249736). And in WebKitLegacy, we'll now also correctly
generate these events. Now there is only one call site for inspector composite hooks.

* Source/WebCore/page/Page.cpp:
(WebCore::Page::willStartRenderingUpdateDisplay):
(WebCore::Page::didCompleteRenderingUpdateDisplay):
(WebCore::Page::willStartPlatformRenderingUpdate): Deleted.
(WebCore::Page::didCompletePlatformRenderingUpdate): Deleted.
* Source/WebCore/page/Page.h:
* Source/WebKit/WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::willStartRenderingUpdateDisplay):
(WebKit::DrawingArea::didCompleteRenderingUpdateDisplay):
* Source/WebKit/WebProcess/WebPage/DrawingArea.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateRendering):
(WebKit::RemoteLayerTreeDrawingArea::didCompleteRenderingUpdateDisplay):
(WebKit::RemoteLayerTreeDrawingArea::addCommitHandlers): Deleted.
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willStartRenderingUpdateDisplay):
(WebKit::WebPage::didCompleteRenderingUpdateDisplay):
(WebKit::WebPage::willStartPlatformRenderingUpdate): Deleted.
(WebKit::WebPage::didCompletePlatformRenderingUpdate): Deleted.
* Source/WebKit/WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::firstFlushAfterCommit const): Deleted.
(WebKit::WebPage::setFirstFlushAfterCommit): Deleted.
* Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedPaintingMilestones):
(WebKit::TiledCoreAnimationDrawingArea::didCompleteRenderingUpdateDisplay):
(WebKit::TiledCoreAnimationDrawingArea::addCommitHandlers):
* Source/WebKitLegacy/mac/WebView/WebView.mm:
(-[WebView _willStartRenderingUpdateDisplay]):
(-[WebView _didCompleteRenderingUpdateDisplay]):
(LayerFlushController::flushLayers):
* Source/WebKitLegacy/mac/WebView/WebViewData.h:
(LayerFlushController::didCompleteRenderingUpdateDisplay):

Canonical link: https://commits.webkit.org/258248@main
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/Generalize-willStartPlatformRenderingUpdatedidCompleteRenderingUpdateDisplay-and-call-for-all-configurations branch from b024fce to 9f0c7ac Compare December 22, 2022 17:56
@webkit-commit-queue
Copy link
Collaborator

Committed 258248@main (9f0c7ac): https://commits.webkit.org/258248@main

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

@webkit-early-warning-system webkit-early-warning-system merged commit 9f0c7ac into WebKit:main Dec 22, 2022
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Dec 22, 2022
@smfr smfr deleted the eng/Generalize-willStartPlatformRenderingUpdatedidCompleteRenderingUpdateDisplay-and-call-for-all-configurations branch January 9, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WebKit Process Model Bugs related to WebKit's multi-process architecture

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants