WebKit Bugzilla
Attachment 360992 Details for
Bug 194199
: PageOverlayController's layers should be created lazily
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194199-20190202200612.patch (text/plain), 34.07 KB, created by
Simon Fraser (smfr)
on 2019-02-02 20:06:13 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-02-02 20:06:13 PST
Size:
34.07 KB
patch
obsolete
>Subversion Revision: 240899 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 4ad2ab8e3d7a647f593c2ed8dfc2aa78c4c30606..286f41c28b39ca1c199c319c263ea452a4784bf6 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,53 @@ >+2019-02-02 Simon Fraser <simon.fraser@apple.com> >+ >+ PageOverlayController's layers should be created lazily >+ https://bugs.webkit.org/show_bug.cgi?id=194199 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays() >+ and use them to only parent the overlay-hosting layers when necessary. >+ >+ For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can >+ simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(), >+ which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer >+ compositing updates that parents the layerWithDocumentOverlays(). >+ >+ View overlays are added to the layer tree via the DrawingArea. When we go between having >+ none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer() >+ on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a >+ compositing flush (this has to be done manually because view overlay layers are outside the >+ subtree managed by RenderLayerCompositor). >+ >+ Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer; >+ there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view >+ overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without >+ having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer(). >+ >+ * loader/EmptyClients.h: >+ * page/ChromeClient.h: >+ * page/FrameView.cpp: >+ (WebCore::FrameView::setNeedsCompositingConfigurationUpdate): These functions need to schedule a compositing flush >+ because there may be nothing else that does. >+ (WebCore::FrameView::setNeedsCompositingGeometryUpdate): >+ * page/Page.cpp: >+ (WebCore::Page::installedPageOverlaysChanged): >+ * page/Page.h: >+ * page/PageOverlayController.cpp: >+ (WebCore::PageOverlayController::hasDocumentOverlays const): >+ (WebCore::PageOverlayController::hasViewOverlays const): >+ (WebCore::PageOverlayController::attachViewOverlayLayers): PageOverlayController has the Page so it >+ might as well be the one to call through the ChromeClient. >+ (WebCore::PageOverlayController::detachViewOverlayLayers): >+ (WebCore::PageOverlayController::installPageOverlay): >+ (WebCore::PageOverlayController::uninstallPageOverlay): >+ * page/PageOverlayController.h: >+ * rendering/RenderLayerCompositor.cpp: >+ (WebCore::RenderLayerCompositor::updateCompositingLayers): isFullUpdate is always true; remove it. >+ (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers): >+ (WebCore::RenderLayerCompositor::attachRootLayer): >+ (WebCore::RenderLayerCompositor::detachRootLayer): >+ > 2019-02-02 Simon Fraser <simon.fraser@apple.com> > > Make setNeedsLayout on the root more explicitly about triggering its side-effects >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index db0e6f0bb438599415f4174446e23eea8140d205..3d260a13d8b8add613b78a36fe428495cd7d1274 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,46 @@ >+2019-02-02 Simon Fraser <simon.fraser@apple.com> >+ >+ PageOverlayController's layers should be created lazily >+ https://bugs.webkit.org/show_bug.cgi?id=194199 >+ rdar://problem/46571593 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays() >+ and use them to only parent the overlay-hosting layers when necessary. >+ >+ For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can >+ simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(), >+ which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer >+ compositing updates that parents the layerWithDocumentOverlays(). >+ >+ View overlays are added to the layer tree via the DrawingArea. When we go between having >+ none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer() >+ on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a >+ compositing flush (this has to be done manually because view overlay layers are outside the >+ subtree managed by RenderLayerCompositor). >+ >+ Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer; >+ there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view >+ overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without >+ having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer(). >+ >+ * WebProcess/WebCoreSupport/WebChromeClient.cpp: >+ (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer): >+ * WebProcess/WebCoreSupport/WebChromeClient.h: >+ * WebProcess/WebPage/AcceleratedDrawingArea.cpp: >+ (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer): >+ * WebProcess/WebPage/AcceleratedDrawingArea.h: >+ * WebProcess/WebPage/DrawingArea.h: >+ (WebKit::DrawingArea::attachViewOverlayGraphicsLayer): >+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: >+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: >+ (WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer): >+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: >+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: >+ (WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer): >+ (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged): >+ > 2019-02-02 Simon Fraser <simon.fraser@apple.com> > > Make setNeedsLayout on the root more explicitly about triggering its side-effects >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 3b8783988da98160a1b26f8b3dda34395f23009f..43e22e1294755350e8a56bae554363f4ccbc5c06 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,15 @@ >+2019-02-02 Simon Fraser <simon.fraser@apple.com> >+ >+ PageOverlayController's layers should be created lazily >+ https://bugs.webkit.org/show_bug.cgi?id=194199 >+ rdar://problem/46571593 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/WebChromeClient.h: >+ * WebCoreSupport/WebChromeClient.mm: >+ (WebChromeClient::attachViewOverlayGraphicsLayer): >+ > 2019-02-02 Simon Fraser <simon.fraser@apple.com> > > Make setNeedsLayout on the root more explicitly about triggering its side-effects >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 47305271543701cd88989c0af70bfa1ab744be9f..363e50dd4b14da1f15d94a9139ea90d57558f57a 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,34 @@ >+2019-02-02 Simon Fraser <simon.fraser@apple.com> >+ >+ PageOverlayController's layers should be created lazily >+ https://bugs.webkit.org/show_bug.cgi?id=194199 >+ rdar://problem/46571593 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays() >+ and use them to only parent the overlay-hosting layers when necessary. >+ >+ For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can >+ simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(), >+ which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer >+ compositing updates that parents the layerWithDocumentOverlays(). >+ >+ View overlays are added to the layer tree via the DrawingArea. When we go between having >+ none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer() >+ on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a >+ compositing flush (this has to be done manually because view overlay layers are outside the >+ subtree managed by RenderLayerCompositor). >+ >+ Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer; >+ there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view >+ overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without >+ having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer(). >+ >+ * WebCoreSupport/WebChromeClient.cpp: >+ (WebChromeClient::attachViewOverlayGraphicsLayer): >+ * WebCoreSupport/WebChromeClient.h: >+ > 2019-01-31 Alex Christensen <achristensen@webkit.org> > > Revert r238819 which is unneeded and caused a performance regression. >diff --git a/Source/WebCore/loader/EmptyClients.h b/Source/WebCore/loader/EmptyClients.h >index ae588f784d204aa95b276cc7a3250728c7f7b614..f05476362b1caf115a555d7a4f306759487f3088 100644 >--- a/Source/WebCore/loader/EmptyClients.h >+++ b/Source/WebCore/loader/EmptyClients.h >@@ -151,7 +151,7 @@ class EmptyChromeClient : public ChromeClient { > void scrollRectIntoView(const IntRect&) const final { } > > void attachRootGraphicsLayer(Frame&, GraphicsLayer*) final { } >- void attachViewOverlayGraphicsLayer(Frame&, GraphicsLayer*) final { } >+ void attachViewOverlayGraphicsLayer(GraphicsLayer*) final { } > void setNeedsOneShotDrawingSynchronization() final { } > void scheduleCompositingLayerFlush() final { } > >diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h >index a75d97c706b991db7f19d77487b1cdc45999cfaf..ec1180763be22407dce9497921ac5d6be0910f12 100644 >--- a/Source/WebCore/page/ChromeClient.h >+++ b/Source/WebCore/page/ChromeClient.h >@@ -308,7 +308,7 @@ public: > > // Pass nullptr as the GraphicsLayer to detatch the root layer. > virtual void attachRootGraphicsLayer(Frame&, GraphicsLayer*) = 0; >- virtual void attachViewOverlayGraphicsLayer(Frame&, GraphicsLayer*) = 0; >+ virtual void attachViewOverlayGraphicsLayer(GraphicsLayer*) = 0; > // Sets a flag to specify that the next time content is drawn to the window, > // the changes appear on the screen in synchrony with updates to GraphicsLayers. > virtual void setNeedsOneShotDrawingSynchronization() = 0; >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index fbf2472f5ca0add030a67ba76fa35f246f7eff8f..d01d47c599fe962f4f294ad2e849625dcb1d4e43 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -2945,6 +2945,7 @@ void FrameView::setNeedsCompositingConfigurationUpdate() > if (renderView->usesCompositing()) { > if (auto* rootLayer = renderView->layer()) > renderView->layer()->setNeedsCompositingConfigurationUpdate(); >+ renderView->compositor().scheduleCompositingLayerUpdate(); > } > } > >@@ -2954,6 +2955,7 @@ void FrameView::setNeedsCompositingGeometryUpdate() > if (renderView->usesCompositing()) { > if (auto* rootLayer = renderView->layer()) > renderView->layer()->setNeedsCompositingGeometryUpdate(); >+ renderView->compositor().scheduleCompositingLayerUpdate(); > } > } > >diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp >index 893fc5838b0ff6951e80564a82adbd4eec131117..78be183006dd7855d3ffb2b3d97aa3f22229c249 100644 >--- a/Source/WebCore/page/Page.cpp >+++ b/Source/WebCore/page/Page.cpp >@@ -2637,6 +2637,19 @@ void Page::appearanceDidChange() > } > } > >+void Page::installedPageOverlaysChanged() >+{ >+ if (isInWindow()) { >+ if (pageOverlayController().hasViewOverlays()) >+ chrome().client().attachViewOverlayGraphicsLayer(&pageOverlayController().layerWithViewOverlays()); >+ else >+ chrome().client().attachViewOverlayGraphicsLayer(nullptr); >+ } >+ >+ if (auto* frameView = mainFrame().view()) >+ frameView->setNeedsCompositingConfigurationUpdate(); >+} >+ > void Page::setUnobscuredSafeAreaInsets(const FloatBoxExtent& insets) > { > if (m_unobscuredSafeAreaInsets == insets) >diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h >index f314ceb9fb34c97dbc617b436920d1a01eeec82d..9464a8ddaf07a543f0b868ab083649caff7204b7 100644 >--- a/Source/WebCore/page/Page.h >+++ b/Source/WebCore/page/Page.h >@@ -413,11 +413,14 @@ public: > > WheelEventDeltaFilter* wheelEventDeltaFilter() { return m_recentWheelEventDeltaFilter.get(); } > PageOverlayController& pageOverlayController() { return *m_pageOverlayController; } >+ >+ void installedPageOverlaysChanged(); > > #if PLATFORM(MAC) > #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION) > ServicesOverlayController& servicesOverlayController() { return *m_servicesOverlayController; } > #endif // ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION) >+ > ScrollLatchingState* latchingState(); > void pushNewLatchingState(); > void popLatchingState(); >diff --git a/Source/WebCore/page/PageOverlayController.cpp b/Source/WebCore/page/PageOverlayController.cpp >index b7eb949696326ac05c68e92ee940f6f9e1835f79..86a68529581683223cf02cedf865930e7661f5c3 100644 >--- a/Source/WebCore/page/PageOverlayController.cpp >+++ b/Source/WebCore/page/PageOverlayController.cpp >@@ -65,6 +65,36 @@ void PageOverlayController::createRootLayersIfNeeded() > m_viewOverlayRootLayer->setName("View overlay container"); > } > >+bool PageOverlayController::hasDocumentOverlays() const >+{ >+ for (const auto& overlay : m_pageOverlays) { >+ if (overlay->overlayType() == PageOverlay::OverlayType::Document) >+ return true; >+ } >+ return false; >+} >+ >+bool PageOverlayController::hasViewOverlays() const >+{ >+ for (const auto& overlay : m_pageOverlays) { >+ if (overlay->overlayType() == PageOverlay::OverlayType::View) >+ return true; >+ } >+ return false; >+} >+ >+void PageOverlayController::attachViewOverlayLayers() >+{ >+ if (hasViewOverlays()) >+ m_page.chrome().client().attachViewOverlayGraphicsLayer(&layerWithViewOverlays()); >+} >+ >+void PageOverlayController::detachViewOverlayLayers() >+{ >+ m_page.chrome().client().attachViewOverlayGraphicsLayer(nullptr); >+ willDetachRootLayer(); >+} >+ > GraphicsLayer* PageOverlayController::documentOverlayRootLayer() const > { > return m_documentOverlayRootLayer.get(); >@@ -144,7 +174,7 @@ void PageOverlayController::installPageOverlay(PageOverlay& overlay, PageOverlay > m_pageOverlays.append(&overlay); > > auto layer = GraphicsLayer::create(m_page.chrome().client().graphicsLayerFactory(), *this); >- layer->setAnchorPoint(FloatPoint3D()); >+ layer->setAnchorPoint({ }); > layer->setBackgroundColor(overlay.backgroundColor()); > layer->setName("Overlay content"); > >@@ -173,6 +203,8 @@ void PageOverlayController::installPageOverlay(PageOverlay& overlay, PageOverlay > > if (fadeMode == PageOverlay::FadeMode::Fade) > overlay.startFadeInAnimation(); >+ >+ m_page.installedPageOverlaysChanged(); > } > > void PageOverlayController::uninstallPageOverlay(PageOverlay& overlay, PageOverlay::FadeMode fadeMode) >@@ -191,6 +223,7 @@ void PageOverlayController::uninstallPageOverlay(PageOverlay& overlay, PageOverl > ASSERT_UNUSED(removed, removed); > > updateForceSynchronousScrollLayerPositionUpdates(); >+ m_page.installedPageOverlaysChanged(); > } > > void PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates() >diff --git a/Source/WebCore/page/PageOverlayController.h b/Source/WebCore/page/PageOverlayController.h >index 82f73684c08c66645a4a915a8c3dfd5cb5ad0887..e61482bbd8a9caaadb75cacc13c7b000fe7e3df3 100644 >--- a/Source/WebCore/page/PageOverlayController.h >+++ b/Source/WebCore/page/PageOverlayController.h >@@ -39,16 +39,20 @@ class PlatformMouseEvent; > > class PageOverlayController final : public GraphicsLayerClient { > WTF_MAKE_FAST_ALLOCATED; >+ friend class MockPageOverlayClient; > public: > PageOverlayController(Page&); > virtual ~PageOverlayController(); > >+ bool hasDocumentOverlays() const; >+ bool hasViewOverlays() const; >+ >+ void attachViewOverlayLayers(); >+ void detachViewOverlayLayers(); >+ > GraphicsLayer& layerWithDocumentOverlays(); > GraphicsLayer& layerWithViewOverlays(); > >- WEBCORE_EXPORT GraphicsLayer* documentOverlayRootLayer() const; >- WEBCORE_EXPORT GraphicsLayer* viewOverlayRootLayer() const; >- > const Vector<RefPtr<PageOverlay>>& pageOverlays() const { return m_pageOverlays; } > > WEBCORE_EXPORT void installPageOverlay(PageOverlay&, PageOverlay::FadeMode); >@@ -59,8 +63,6 @@ public: > void clearPageOverlay(PageOverlay&); > GraphicsLayer& layerForOverlay(PageOverlay&) const; > >- void willDetachRootLayer(); >- > void didChangeViewSize(); > void didChangeDocumentSize(); > void didChangeSettings(); >@@ -82,6 +84,11 @@ public: > private: > void createRootLayersIfNeeded(); > >+ WEBCORE_EXPORT GraphicsLayer* documentOverlayRootLayer() const; >+ WEBCORE_EXPORT GraphicsLayer* viewOverlayRootLayer() const; >+ >+ void willDetachRootLayer(); >+ > void updateSettingsForLayer(GraphicsLayer&); > void updateForceSynchronousScrollLayerPositionUpdates(); > >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp >index 97c17864fa4f8628adc66406a62109d25e419506..d2f250b7d5704e7fb9e75330ffac1018b4250b1f 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp >+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp >@@ -674,8 +674,10 @@ bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update > > // Avoid updating the layers with old values. Compositing layers will be updated after the layout is finished. > // This happens when m_updateCompositingLayersTimer fires before layout is updated. >- if (m_renderView.needsLayout()) >+ if (m_renderView.needsLayout()) { >+ LOG_WITH_STREAM(Compositing, stream << "RenderLayerCompositor " << this << " updateCompositingLayers " << updateType << " - m_renderView.needsLayout, bailing "); > return false; >+ } > > if (!m_compositing && (m_forceCompositingMode || (isMainFrameCompositor() && page().pageOverlayController().overlayCount()))) > enableCompositingMode(true); >@@ -708,7 +710,6 @@ bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update > return true; > } > >- bool isFullUpdate = true; > ++m_compositingUpdateCount; > > AnimationUpdateBlock animationUpdateBlock(&m_renderView.frameView().frame().animation()); >@@ -758,15 +759,13 @@ bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update > updateBackingAndHierarchy(*updateRoot, childList, scrollingTreeState); > > // Host the document layer in the RenderView's root layer. >- if (isFullUpdate) { >- appendDocumentOverlayLayers(childList); >- // Even when childList is empty, don't drop out of compositing mode if there are >- // composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden). >- if (childList.isEmpty() && !needsCompositingForContentOrOverlays()) >- destroyRootLayer(); >- else if (m_rootContentsLayer) >- m_rootContentsLayer->setChildren(WTFMove(childList)); >- } >+ appendDocumentOverlayLayers(childList); >+ // Even when childList is empty, don't drop out of compositing mode if there are >+ // composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden). >+ if (childList.isEmpty() && !needsCompositingForContentOrOverlays()) >+ destroyRootLayer(); >+ else if (m_rootContentsLayer) >+ m_rootContentsLayer->setChildren(WTFMove(childList)); > } > > #if !LOG_DISABLED >@@ -1272,6 +1271,9 @@ void RenderLayerCompositor::appendDocumentOverlayLayers(Vector<Ref<GraphicsLayer > if (!isMainFrameCompositor() || !m_compositing) > return; > >+ if (!page().pageOverlayController().hasDocumentOverlays()) >+ return; >+ > Ref<GraphicsLayer> overlayHost = page().pageOverlayController().layerWithDocumentOverlays(); > childList.append(WTFMove(overlayHost)); > } >@@ -3544,8 +3546,6 @@ void RenderLayerCompositor::attachRootLayer(RootLayerAttachment attachment) > case RootLayerAttachedViaChromeClient: { > auto& frame = m_renderView.frameView().frame(); > page().chrome().client().attachRootGraphicsLayer(frame, rootGraphicsLayer()); >- if (frame.isMainFrame()) >- page().chrome().client().attachViewOverlayGraphicsLayer(frame, &page().pageOverlayController().layerWithViewOverlays()); > break; > } > case RootLayerAttachedViaEnclosingFrame: { >@@ -3592,10 +3592,6 @@ void RenderLayerCompositor::detachRootLayer() > case RootLayerAttachedViaChromeClient: { > auto& frame = m_renderView.frameView().frame(); > page().chrome().client().attachRootGraphicsLayer(frame, nullptr); >- if (frame.isMainFrame()) { >- page().chrome().client().attachViewOverlayGraphicsLayer(frame, nullptr); >- page().pageOverlayController().willDetachRootLayer(); >- } > } > break; > case RootLayerUnattached: >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >index 9a684152eed74fc40f173d170710595456cf3702..cc605ffe91497eace50e61f0ed5bea4558f50d61 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >@@ -892,10 +892,10 @@ void WebChromeClient::attachRootGraphicsLayer(Frame&, GraphicsLayer* layer) > m_page.exitAcceleratedCompositingMode(); > } > >-void WebChromeClient::attachViewOverlayGraphicsLayer(Frame& frame, GraphicsLayer* graphicsLayer) >+void WebChromeClient::attachViewOverlayGraphicsLayer(GraphicsLayer* graphicsLayer) > { > if (auto drawingArea = m_page.drawingArea()) >- drawingArea->attachViewOverlayGraphicsLayer(&frame, graphicsLayer); >+ drawingArea->attachViewOverlayGraphicsLayer(graphicsLayer); > } > > void WebChromeClient::setNeedsOneShotDrawingSynchronization() >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >index 38048be9d836e6870e7877eb69840969814d63e7..9d07505c0f899b2d47eead16a09ba70abb726c06 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >@@ -212,7 +212,7 @@ private: > > WebCore::GraphicsLayerFactory* graphicsLayerFactory() const final; > void attachRootGraphicsLayer(WebCore::Frame&, WebCore::GraphicsLayer*) final; >- void attachViewOverlayGraphicsLayer(WebCore::Frame&, WebCore::GraphicsLayer*) final; >+ void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) final; > void setNeedsOneShotDrawingSynchronization() final; > void scheduleCompositingLayerFlush() final; > bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) final; >diff --git a/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp b/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp >index 9920465b17392a8314cf2d05c31533f5606d2011..edfe46b218e050fc02edfb2b976f0dfdedc0de7f 100644 >--- a/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp >+++ b/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp >@@ -470,11 +470,8 @@ void AcceleratedDrawingArea::activityStateDidChange(OptionSet<ActivityState::Fla > } > } > >-void AcceleratedDrawingArea::attachViewOverlayGraphicsLayer(Frame* frame, GraphicsLayer* viewOverlayRootLayer) >+void AcceleratedDrawingArea::attachViewOverlayGraphicsLayer(GraphicsLayer* viewOverlayRootLayer) > { >- if (!frame->isMainFrame()) >- return; >- > if (m_layerTreeHost) > m_layerTreeHost->setViewOverlayRootLayer(viewOverlayRootLayer); > else if (m_previousLayerTreeHost) >diff --git a/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h b/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h >index 70abe435925cbf37dbc3d2d874dbf483f4c8f19e..0927d44d004756ebf6738f918e2ddad32168cf0e 100644 >--- a/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h >+++ b/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h >@@ -70,7 +70,7 @@ protected: > #endif > > void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag>, ActivityStateChangeID, const Vector<CallbackID>& /* callbackIDs */) override; >- void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override; >+ void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) override; > > void layerHostDidFlushLayers() override; > >diff --git a/Source/WebKit/WebProcess/WebPage/DrawingArea.h b/Source/WebKit/WebProcess/WebPage/DrawingArea.h >index c69033e892d9b6e10b05465b59d6348b9cb71616..6d8459d3a6bad09fd015727f6f2ddf6c8fc5b8bf 100644 >--- a/Source/WebKit/WebProcess/WebPage/DrawingArea.h >+++ b/Source/WebKit/WebProcess/WebPage/DrawingArea.h >@@ -128,7 +128,7 @@ public: > > virtual bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) { return false; } > >- virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) { } >+ virtual void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) { } > > virtual void setShouldScaleViewToFitDocument(bool) { } > >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h >index ccfaab8fd46b8bef6828de5bc43ae4cca87f033d..711e2582e1e5b50a208c65712a07fe12f2d2fd6a 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h >@@ -66,7 +66,7 @@ private: > void scheduleInitialDeferredPaint() override; > void scheduleCompositingLayerFlush() override; > void scheduleCompositingLayerFlushImmediately() override; >- void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override; >+ void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) override; > > void addTransactionCallbackID(CallbackID) override; > >@@ -172,8 +172,8 @@ private: > > OptionSet<WebCore::LayoutMilestone> m_pendingNewlyReachedLayoutMilestones; > >- WebCore::GraphicsLayer* m_contentLayer { nullptr }; >- WebCore::GraphicsLayer* m_viewOverlayRootLayer { nullptr }; >+ RefPtr<WebCore::GraphicsLayer> m_contentLayer; >+ RefPtr<WebCore::GraphicsLayer> m_viewOverlayRootLayer; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >index 1086c6fdfc210a8e34760464d6bc416392959c3e..ce2d5cbdece8d9dc5177168df056109a30ee89b2 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >@@ -125,11 +125,8 @@ void RemoteLayerTreeDrawingArea::updateRootLayers() > m_rootLayer->setChildren(WTFMove(children)); > } > >-void RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer(Frame* frame, GraphicsLayer* viewOverlayRootLayer) >+void RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer(GraphicsLayer* viewOverlayRootLayer) > { >- if (!frame->isMainFrame()) >- return; >- > m_viewOverlayRootLayer = viewOverlayRootLayer; > updateRootLayers(); > } >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 7d5785272811c4c43153aeefc4d2f917f887dff5..c8d694e75d65188819af01f4b994f2d9d8b1dbd2 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -1220,7 +1220,7 @@ void WebPage::enterAcceleratedCompositingMode(GraphicsLayer* layer) > > void WebPage::exitAcceleratedCompositingMode() > { >- m_drawingArea->setRootCompositingLayer(0); >+ m_drawingArea->setRootCompositingLayer(nullptr); > } > > void WebPage::close() >diff --git a/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h b/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h >index aaa512d7da9845dd7de102bac90ff73a07222028..9411ed26212ae1850e22774f31936b073ed7f95a 100644 >--- a/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h >+++ b/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h >@@ -84,7 +84,7 @@ private: > void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag> changed, ActivityStateChangeID, const Vector<CallbackID>&) override; > void didUpdateActivityStateTimerFired(); > >- void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override; >+ void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) override; > > bool dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>) override; > >@@ -163,7 +163,7 @@ private: > Vector<CallbackID> m_nextActivityStateChangeCallbackIDs; > ActivityStateChangeID m_activityStateChangeID { ActivityStateChangeAsynchronous }; > >- WebCore::GraphicsLayer* m_viewOverlayRootLayer; >+ RefPtr<WebCore::GraphicsLayer> m_viewOverlayRootLayer; > > bool m_shouldScaleViewToFitDocument { false }; > bool m_isScalingViewToFitDocument { false }; >diff --git a/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm b/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >index 99708c136448770c11e1b377f72748a90ea08e33..b5916074ce2221334d63a9b850065518d28363ee 100644 >--- a/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >+++ b/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >@@ -270,18 +270,15 @@ void TiledCoreAnimationDrawingArea::updateRootLayers() > [m_hostingLayer addSublayer:m_debugInfoLayer.get()]; > } > >-void TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer(Frame* frame, GraphicsLayer* viewOverlayRootLayer) >+void TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer(GraphicsLayer* viewOverlayRootLayer) > { >- if (!frame->isMainFrame()) >- return; >- > m_viewOverlayRootLayer = viewOverlayRootLayer; > updateRootLayers(); >+ scheduleCompositingLayerFlush(); > } > > void TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged(const IntSize& size) > { >- > } > > void TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded() >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h >index 37a32f87687164f039be98b3d0e7e72635a1a8d9..febb01b0214ea5900609c7ae87b76b403a9b9eef 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h >@@ -168,7 +168,7 @@ private: > bool shouldPaintEntireContents() const final; > > void attachRootGraphicsLayer(WebCore::Frame&, WebCore::GraphicsLayer*) override; >- void attachViewOverlayGraphicsLayer(WebCore::Frame&, WebCore::GraphicsLayer*) final; >+ void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) final; > void setNeedsOneShotDrawingSynchronization() final; > void scheduleCompositingLayerFlush() final; > >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm >index 3e0a5c2726f5816be90ffeac1279daebe6462350..cb030d2adc935a4e8888a14c66886f8eae4b4806 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm >@@ -948,7 +948,7 @@ void WebChromeClient::attachRootGraphicsLayer(Frame& frame, GraphicsLayer* graph > #endif > } > >-void WebChromeClient::attachViewOverlayGraphicsLayer(Frame&, GraphicsLayer*) >+void WebChromeClient::attachViewOverlayGraphicsLayer(GraphicsLayer*) > { > // FIXME: If we want view-relative page overlays in Legacy WebKit, this would be the place to hook them up. > } >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp b/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp >index cec75fae69d22ad40ad6e2900b8c6a143aa5c700..0fcb912a5d3251e719e3d8cd9f64369968f5ef5d 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp >@@ -727,7 +727,7 @@ void WebChromeClient::attachRootGraphicsLayer(Frame&, GraphicsLayer* graphicsLay > m_webView->setRootChildLayer(graphicsLayer); > } > >-void WebChromeClient::attachViewOverlayGraphicsLayer(Frame&, GraphicsLayer*) >+void WebChromeClient::attachViewOverlayGraphicsLayer(GraphicsLayer*) > { > // FIXME: If we want view-relative page overlays in Legacy WebKit on Windows, this would be the place to hook them up. > } >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.h b/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.h >index be1cd2c44244cc5c0994a97f3611250514ec3df2..cc41d42823732a68e0f05d164fa584fc6d806823 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.h >@@ -123,7 +123,7 @@ public: > > // Pass 0 as the GraphicsLayer to detatch the root layer. > void attachRootGraphicsLayer(WebCore::Frame&, WebCore::GraphicsLayer*) final; >- void attachViewOverlayGraphicsLayer(WebCore::Frame&, WebCore::GraphicsLayer*) final; >+ void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) final; > // Sets a flag to specify that the next time content is drawn to the window, > // the changes appear on the screen in synchrony with updates to GraphicsLayers. > void setNeedsOneShotDrawingSynchronization() final { }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194199
:
360992
|
361035
|
361080