-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add a "post rendering frame" hook #8020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a "post rendering frame" hook #8020
Conversation
|
EWS run on previous version of this PR (hash e5a810d)
|
e5a810d to
7203718
Compare
|
EWS run on previous version of this PR (hash 7203718)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an assertion that this is back to the main/web thread?
Source/WebCore/page/Page.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be ideal to all these updating per WindowEventLoop object. e.g. cross-site contents in a single Page may not share EventLoop object (this is especially true once site isolation is implemented).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but I'd rather do that later. It should be pretty clean; the Page updateRendering code is in a good state.
cdumez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: We don't need to specify the whole type nowadays:
RefPtr protectedFlushController { m_flushController };
7203718 to
118d365
Compare
|
EWS run on current version of this PR (hash 118d365)
|
https://bugs.webkit.org/show_bug.cgi?id=249807 rdar://103648840 Reviewed by Chris Dumez and Ryosuke Niwa. We need to add a Page-level "post rendering frame" hook so we can do things like hook up postRequestAnimationFrame() (webkit.org/b/249798), possibly run the WindowEventLoop (webkit.org/b/249684) and correctly implement Inspectors "frame end" event (webkit.org/b/249796). For Core Animation-driven drawing clients (TiledCoreAnimationDrawingArea, WebKitLegacy) we want this post-rendering frame hook to run after CA's runloop observer returns, since this callback may run arbitrary script at some point and we need to avoid any possible re-entrancy issues. So we use a second CFRunLoopObserver, ordered as CoreAnimationCommit+2 (after InspectorFrameEnd). For RemoteLayerTreeDrawingArea, we can just call the entry point after didCompleteRenderingUpdateDisplay(). * Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::internalStart): * Source/WebCore/page/Page.cpp: (WebCore::Page::didCompleteRenderingFrame): * Source/WebCore/page/Page.h: * Source/WebCore/platform/cf/RunLoopObserver.cpp: (WebCore::RunLoopObserver::schedule): * Source/WebCore/platform/cf/RunLoopObserver.h: Modernize terminology: LayerFlush -> RenderingUpdate and add PostRenderingUpdate. * Source/WebKit/WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::didCompleteRenderingFrame): * Source/WebKit/WebProcess/WebPage/DrawingArea.h: * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::updateRendering): * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCompleteRenderingFrame): * Source/WebKit/WebProcess/WebPage/WebPage.h: * Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): (WebKit::TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea): (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen): (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition): (WebKit::TiledCoreAnimationDrawingArea::didCompleteRenderingUpdateDisplay): (WebKit::TiledCoreAnimationDrawingArea::scheduleRenderingUpdateRunLoopObserver): (WebKit::TiledCoreAnimationDrawingArea::invalidateRenderingUpdateRunLoopObserver): (WebKit::TiledCoreAnimationDrawingArea::renderingUpdateRunLoopCallback): (WebKit::TiledCoreAnimationDrawingArea::schedulePostRenderingUpdateRunLoopObserver): (WebKit::TiledCoreAnimationDrawingArea::invalidatePostRenderingUpdateRunLoopObserver): (WebKit::TiledCoreAnimationDrawingArea::postRenderingUpdateRunLoopCallback): (WebKit::TiledCoreAnimationDrawingArea::updateRenderingRunLoopCallback): Deleted. * Source/WebKitLegacy/mac/WebView/WebView.mm: (-[WebView _didCompleteRenderingUpdateDisplay]): * Source/WebKitLegacy/mac/WebView/WebViewData.mm: (WebViewLayerFlushScheduler::WebViewLayerFlushScheduler): Canonical link: https://commits.webkit.org/258311@main
118d365 to
bf82da4
Compare
|
Committed 258311@main (bf82da4): https://commits.webkit.org/258311@main Reviewed commits have been landed. Closing PR #8020 and removing active labels. |
bf82da4
118d365