WebKit Bugzilla
Attachment 359036 Details for
Bug 193394
: Make the scrolling code use "Async" instead of "Coordinated"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
0001-Make-the-scrolling-code-use-Async-instead-of-Coordin.patch (text/plain), 34.39 KB, created by
Frédéric Wang (:fredw)
on 2019-01-14 07:42:30 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2019-01-14 07:42:30 PST
Size:
34.39 KB
patch
obsolete
>From c588e62716d89d428c2022de230d5fa09a706928 Mon Sep 17 00:00:00 2001 >From: Frederic Wang <fwang@igalia.com> >Date: Mon, 14 Jan 2019 16:37:31 +0100 >Subject: [PATCH xserver] Make the scrolling code use "Async" instead of > "Coordinated" > >--- > Source/WebCore/ChangeLog | 64 +++++++++ > Source/WebCore/page/FrameView.cpp | 2 +- > .../page/scrolling/ScrollingCoordinator.h | 2 + > .../WebCore/rendering/RenderLayerBacking.cpp | 16 +-- > Source/WebCore/rendering/RenderLayerBacking.h | 18 +-- > .../rendering/RenderLayerCompositor.cpp | 128 +++++++++--------- > .../WebCore/rendering/RenderLayerCompositor.h | 27 ++-- > 7 files changed, 161 insertions(+), 96 deletions(-) > >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 28e33086034..a31401bf0c0 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,67 @@ >+2019-01-14 Frederic Wang <fwang@igalia.com> >+ >+ Make the scrolling code use "Async" instead of "Coordinated" >+ https://bugs.webkit.org/show_bug.cgi?id=193394 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In several places of the code, functions to manage "coordinated scrolling" actually assumes >+ the presence of a scrolling tree i.e. an AsyncScrollingCoordinator and hence is actually >+ "async" scrolling. This patch renames ScrollCoordination, ScrollCoordinated, >+ CoordinatedScrolling etc to use "Async" instead of "Coordinated". >+ >+ * page/FrameView.cpp: >+ (WebCore::FrameView::scrollLayerID const): >+ * rendering/RenderLayerBacking.cpp: >+ (WebCore::RenderLayerBacking::~RenderLayerBacking): >+ (WebCore::RenderLayerBacking::updateGeometry): >+ (WebCore::RenderLayerBacking::detachFromScrollingCoordinator): >+ (WebCore::RenderLayerBacking::setIsAsyncScrolledWithViewportConstrainedRole): >+ (WebCore::operator<<): >+ (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole): Deleted. >+ * rendering/RenderLayerBacking.h: >+ * rendering/RenderLayerCompositor.cpp: >+ (WebCore::RenderLayerCompositor::flushPendingLayerChanges): >+ (WebCore::RenderLayerCompositor::updateAsyncScrolledLayersAfterFlushIncludingSubframes): >+ (WebCore::RenderLayerCompositor::updateAsyncScrolledLayersAfterFlush): >+ (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): >+ (WebCore::RenderLayerCompositor::didFlushChangesForLayer): >+ (WebCore::RenderLayerCompositor::updateBacking): >+ (WebCore::RenderLayerCompositor::layerWillBeRemoved): >+ (WebCore::RenderLayerCompositor::hasAsyncScrolling const): >+ (WebCore::RenderLayerCompositor::frameViewDidScroll): >+ (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): >+ (WebCore::RenderLayerCompositor::setIsInWindow): >+ (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants): >+ (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const): >+ (WebCore::RenderLayerCompositor::useAsyncScrollingForLayer const): >+ (WebCore::RenderLayerCompositor::ensureRootLayer): >+ (WebCore::canUseAsyncScrollingForLayer): >+ (WebCore::RenderLayerCompositor::updateAsyncScrollingStatus): >+ (WebCore::RenderLayerCompositor::removeFromAsyncScrolledLayers): >+ (WebCore::asyncScrolledAncestorInParentOfFrame): >+ (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): >+ (WebCore::asyncScrollingRoleForNodeType): >+ (WebCore::RenderLayerCompositor::attachScrollingNode): >+ (WebCore::RenderLayerCompositor::detachAsyncScrolledLayer): >+ (WebCore::RenderLayerCompositor::updateAsyncScrollingForThisFrame): >+ (WebCore::RenderLayerCompositor::updateAsyncScrolledLayer): >+ (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): >+ (WebCore::RenderLayerCompositor::didAddScrollingLayer): >+ (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubframes): Deleted. >+ (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush): Deleted. >+ (WebCore::RenderLayerCompositor::hasCoordinatedScrolling const): Deleted. >+ (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const): Deleted. >+ (WebCore::canCoordinateScrollingForLayer): Deleted. >+ (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Deleted. >+ (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers): Deleted. >+ (WebCore::scrollCoordinatedAncestorInParentOfFrame): Deleted. >+ (WebCore::scrollCoordinationRoleForNodeType): Deleted. >+ (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Deleted. >+ (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Deleted. >+ (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Deleted. >+ * rendering/RenderLayerCompositor.h: >+ > 2019-01-13 Carlos Garcia Campos <cgarcia@igalia.com> > > [FreeType] Support emoji modifiers >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index d25a7e61a7a..482cfa2da9e 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -905,7 +905,7 @@ uint64_t FrameView::scrollLayerID() const > if (!backing) > return 0; > >- return backing->scrollingNodeIDForRole(ScrollCoordinationRole::Scrolling); >+ return backing->scrollingNodeIDForRole(AsyncScrollingRole::Scrolling); > } > > ScrollableArea* FrameView::scrollableAreaForScrollLayerID(uint64_t nodeID) const >diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.h b/Source/WebCore/page/scrolling/ScrollingCoordinator.h >index 614b6705574..6e74d2ef60c 100644 >--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h >+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.h >@@ -127,8 +127,10 @@ public: > > WEBCORE_EXPORT virtual void pageDestroyed(); > >+#if ENABLE(ASYNC_SCROLLING) > virtual bool isAsyncScrollingCoordinator() const { return false; } > virtual bool isRemoteScrollingCoordinator() const { return false; } >+#endif // ENABLE(ASYNC_SCROLLING) > > // Return whether this scrolling coordinator handles scrolling for the given frame view. > virtual bool coordinatesScrollingForFrameView(const FrameView&) const; >diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp >index be8bba0a7c8..459c6c788c1 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.cpp >+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp >@@ -244,7 +244,7 @@ RenderLayerBacking::~RenderLayerBacking() > updateBackgroundLayer(false); > updateMaskingLayer(false, false); > updateScrollingLayers(false); >- detachFromScrollingCoordinator({ ScrollCoordinationRole::Scrolling, ScrollCoordinationRole::ViewportConstrained }); >+ detachFromScrollingCoordinator({ AsyncScrollingRole::Scrolling, AsyncScrollingRole::ViewportConstrained }); > destroyGraphicsLayers(); > } > >@@ -1252,7 +1252,7 @@ void RenderLayerBacking::updateGeometry() > if (subpixelOffsetFromRendererChanged(oldSubpixelOffsetFromRenderer, m_subpixelOffsetFromRenderer, deviceScaleFactor()) && canIssueSetNeedsDisplay()) > setContentsNeedDisplay(); > >- compositor().updateScrollCoordinatedStatus(m_owningLayer, { RenderLayerCompositor::ScrollingNodeChangeFlags::Layer, RenderLayerCompositor::ScrollingNodeChangeFlags::LayerGeometry }); >+ compositor().updateAsyncScrollingStatus(m_owningLayer, { RenderLayerCompositor::ScrollingNodeChangeFlags::Layer, RenderLayerCompositor::ScrollingNodeChangeFlags::LayerGeometry }); > } > > void RenderLayerBacking::updateAfterDescendants() >@@ -1772,7 +1772,7 @@ bool RenderLayerBacking::updateScrollingLayers(bool needsScrollingLayers) > return true; > } > >-void RenderLayerBacking::detachFromScrollingCoordinator(OptionSet<ScrollCoordinationRole> roles) >+void RenderLayerBacking::detachFromScrollingCoordinator(OptionSet<AsyncScrollingRole> roles) > { > if (!m_scrollingNodeID && !m_viewportConstrainedNodeID) > return; >@@ -1781,20 +1781,20 @@ void RenderLayerBacking::detachFromScrollingCoordinator(OptionSet<ScrollCoordina > if (!scrollingCoordinator) > return; > >- if ((roles.contains(ScrollCoordinationRole::Scrolling)) && m_scrollingNodeID) { >+ if ((roles.contains(AsyncScrollingRole::Scrolling)) && m_scrollingNodeID) { > LOG(Compositing, "Detaching Scrolling node %" PRIu64, m_scrollingNodeID); > scrollingCoordinator->detachFromStateTree(m_scrollingNodeID); > m_scrollingNodeID = 0; > } > >- if ((roles.contains(ScrollCoordinationRole::ViewportConstrained)) && m_viewportConstrainedNodeID) { >+ if ((roles.contains(AsyncScrollingRole::ViewportConstrained)) && m_viewportConstrainedNodeID) { > LOG(Compositing, "Detaching ViewportConstrained node %" PRIu64, m_viewportConstrainedNodeID); > scrollingCoordinator->detachFromStateTree(m_viewportConstrainedNodeID); > m_viewportConstrainedNodeID = 0; > } > } > >-void RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole(bool viewportCoordinated) >+void RenderLayerBacking::setIsAsyncScrolledWithViewportConstrainedRole(bool viewportCoordinated) > { > m_graphicsLayer->setIsViewportConstrained(viewportCoordinated); > } >@@ -3082,9 +3082,9 @@ TextStream& operator<<(TextStream& ts, const RenderLayerBacking& backing) > ts << " paintsIntoCompositedAncestor"; > > ts << " primary layer ID " << backing.graphicsLayer()->primaryLayerID(); >- if (auto nodeID = backing.scrollingNodeIDForRole(ScrollCoordinationRole::ViewportConstrained)) >+ if (auto nodeID = backing.scrollingNodeIDForRole(AsyncScrollingRole::ViewportConstrained)) > ts << " viewport constrained scrolling node " << nodeID; >- if (auto nodeID = backing.scrollingNodeIDForRole(ScrollCoordinationRole::Scrolling)) >+ if (auto nodeID = backing.scrollingNodeIDForRole(AsyncScrollingRole::Scrolling)) > ts << " scrolling node " << nodeID; > return ts; > } >diff --git a/Source/WebCore/rendering/RenderLayerBacking.h b/Source/WebCore/rendering/RenderLayerBacking.h >index 8d5f43c4815..8514541da14 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.h >+++ b/Source/WebCore/rendering/RenderLayerBacking.h >@@ -105,35 +105,35 @@ public: > GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); } > GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLayer.get(); } > >- void detachFromScrollingCoordinator(OptionSet<ScrollCoordinationRole>); >+ void detachFromScrollingCoordinator(OptionSet<AsyncScrollingRole>); > >- ScrollingNodeID scrollingNodeIDForRole(ScrollCoordinationRole role) const >+ ScrollingNodeID scrollingNodeIDForRole(AsyncScrollingRole role) const > { > switch (role) { >- case ScrollCoordinationRole::Scrolling: >+ case AsyncScrollingRole::Scrolling: > return m_scrollingNodeID; >- case ScrollCoordinationRole::ViewportConstrained: >+ case AsyncScrollingRole::ViewportConstrained: > return m_viewportConstrainedNodeID; > } > return 0; > } > >- void setScrollingNodeIDForRole(ScrollingNodeID nodeID, ScrollCoordinationRole role) >+ void setScrollingNodeIDForRole(ScrollingNodeID nodeID, AsyncScrollingRole role) > { > switch (role) { >- case ScrollCoordinationRole::Scrolling: >+ case AsyncScrollingRole::Scrolling: > m_scrollingNodeID = nodeID; > break; >- case ScrollCoordinationRole::ViewportConstrained: >+ case AsyncScrollingRole::ViewportConstrained: > m_viewportConstrainedNodeID = nodeID; >- setIsScrollCoordinatedWithViewportConstrainedRole(nodeID); >+ setIsAsyncScrolledWithViewportConstrainedRole(nodeID); > break; > } > } > > ScrollingNodeID scrollingNodeIDForChildren() const { return m_scrollingNodeID ? m_scrollingNodeID : m_viewportConstrainedNodeID; } > >- void setIsScrollCoordinatedWithViewportConstrainedRole(bool); >+ void setIsAsyncScrolledWithViewportConstrainedRole(bool); > > bool hasMaskLayer() const { return m_maskLayer; } > bool hasChildClippingMaskLayer() const { return m_childClippingMaskLayer != nullptr; } >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp >index a8a2583190d..d760751bb96 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp >+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp >@@ -490,7 +490,7 @@ void RenderLayerCompositor::flushPendingLayerChanges(bool isFlushRoot) > ASSERT(m_flushingLayers); > } > >- updateScrollCoordinatedLayersAfterFlushIncludingSubframes(); >+ updateAsyncScrolledLayersAfterFlushIncludingSubframes(); > > #if PLATFORM(IOS_FAMILY) > if (isFlushRoot) >@@ -501,9 +501,9 @@ void RenderLayerCompositor::flushPendingLayerChanges(bool isFlushRoot) > startLayerFlushTimerIfNeeded(); > } > >-void RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubframes() >+void RenderLayerCompositor::updateAsyncScrolledLayersAfterFlushIncludingSubframes() > { >- updateScrollCoordinatedLayersAfterFlush(); >+ updateAsyncScrolledLayersAfterFlush(); > > auto& frame = m_renderView.frameView().frame(); > for (Frame* subframe = frame.tree().firstChild(); subframe; subframe = subframe->tree().traverseNext(&frame)) { >@@ -511,26 +511,26 @@ void RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubf > if (!view) > continue; > >- view->compositor().updateScrollCoordinatedLayersAfterFlush(); >+ view->compositor().updateAsyncScrolledLayersAfterFlush(); > } > } > >-void RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush() >+void RenderLayerCompositor::updateAsyncScrolledLayersAfterFlush() > { > updateCustomLayersAfterFlush(); > > HashSet<RenderLayer*> layersNeedingUpdate; >- std::swap(m_scrollCoordinatedLayersNeedingUpdate, layersNeedingUpdate); >+ std::swap(m_asyncScrolledLayersNeedingUpdate, layersNeedingUpdate); > > for (auto* layer : layersNeedingUpdate) >- updateScrollCoordinatedStatus(*layer, ScrollingNodeChangeFlags::Layer); >+ updateAsyncScrollingStatus(*layer, ScrollingNodeChangeFlags::Layer); > } > > void RenderLayerCompositor::updateCustomLayersAfterFlush() > { > #if PLATFORM(IOS_FAMILY) > if (m_legacyScrollingLayerCoordinator) { >- m_legacyScrollingLayerCoordinator->registerAllViewportConstrainedLayers(*this, m_scrollCoordinatedLayers); >+ m_legacyScrollingLayerCoordinator->registerAllViewportConstrainedLayers(*this, m_asyncScrolledLayers); > m_legacyScrollingLayerCoordinator->registerScrollingLayersNeedingUpdate(); > } > #endif >@@ -538,8 +538,8 @@ void RenderLayerCompositor::updateCustomLayersAfterFlush() > > void RenderLayerCompositor::didFlushChangesForLayer(RenderLayer& layer, const GraphicsLayer* graphicsLayer) > { >- if (m_scrollCoordinatedLayers.contains(&layer)) >- m_scrollCoordinatedLayersNeedingUpdate.add(&layer); >+ if (m_asyncScrolledLayers.contains(&layer)) >+ m_asyncScrolledLayersNeedingUpdate.add(&layer); > > #if PLATFORM(IOS_FAMILY) > if (m_legacyScrollingLayerCoordinator) >@@ -1496,8 +1496,8 @@ bool RenderLayerCompositor::updateBacking(RenderLayer& layer, RequiresCompositin > > layer.ensureBacking(); > >- if (layer.isRenderViewLayer() && useCoordinatedScrollingForLayer(layer)) { >- updateScrollCoordinatedStatus(layer, { ScrollingNodeChangeFlags::Layer, ScrollingNodeChangeFlags::LayerGeometry }); >+ if (layer.isRenderViewLayer() && useAsyncScrollingForLayer(layer)) { >+ updateAsyncScrollingStatus(layer, { ScrollingNodeChangeFlags::Layer, ScrollingNodeChangeFlags::LayerGeometry }); > if (auto* scrollingCoordinator = this->scrollingCoordinator()) > scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView()); > #if ENABLE(RUBBER_BANDING) >@@ -1534,7 +1534,7 @@ bool RenderLayerCompositor::updateBacking(RenderLayer& layer, RequiresCompositin > } > } > >- removeFromScrollCoordinatedLayers(layer); >+ removeFromAsyncScrolledLayers(layer); > > layer.clearBacking(); > layerChanged = true; >@@ -1644,7 +1644,7 @@ void RenderLayerCompositor::layerWillBeRemoved(RenderLayer& parent, RenderLayer& > if (!child.isComposited() || parent.renderer().renderTreeBeingDestroyed()) > return; > >- removeFromScrollCoordinatedLayers(child); >+ removeFromAsyncScrolledLayers(child); > repaintInCompositedAncestor(child, child.backing()->compositedBounds()); // FIXME: do via dirty bits? > > setCompositingParent(child, nullptr); >@@ -1803,7 +1803,7 @@ void RenderLayerCompositor::frameViewDidChangeSize() > } > } > >-bool RenderLayerCompositor::hasCoordinatedScrolling() const >+bool RenderLayerCompositor::hasAsyncScrolling() const > { > auto* scrollingCoordinator = this->scrollingCoordinator(); > return scrollingCoordinator && scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView()); >@@ -1838,7 +1838,7 @@ void RenderLayerCompositor::frameViewDidScroll() > > // If there's a scrolling coordinator that manages scrolling for this frame view, > // it will also manage updating the scroll layer position. >- if (hasCoordinatedScrolling()) { >+ if (hasAsyncScrolling()) { > // We have to schedule a flush in order for the main TiledBacking to update its tile coverage. > scheduleLayerFlushNow(); > return; >@@ -1879,7 +1879,7 @@ void RenderLayerCompositor::fixedRootBackgroundLayerChanged() > return; > > if (m_renderView.layer()->isComposited()) >- updateScrollCoordinatedStatus(*m_renderView.layer(), ScrollingNodeChangeFlags::Layer); >+ updateAsyncScrollingStatus(*m_renderView.layer(), ScrollingNodeChangeFlags::Layer); > } > > String RenderLayerCompositor::layerTreeAsText(LayerTreeFlags flags) >@@ -2016,7 +2016,7 @@ void RenderLayerCompositor::setIsInWindow(bool isInWindow) > attachRootLayer(attachment); > #if PLATFORM(IOS_FAMILY) > if (m_legacyScrollingLayerCoordinator) { >- m_legacyScrollingLayerCoordinator->registerAllViewportConstrainedLayers(*this, m_scrollCoordinatedLayers); >+ m_legacyScrollingLayerCoordinator->registerAllViewportConstrainedLayers(*this, m_asyncScrolledLayers); > m_legacyScrollingLayerCoordinator->registerAllScrollingLayers(); > } > #endif >@@ -2037,7 +2037,7 @@ void RenderLayerCompositor::setIsInWindow(bool isInWindow) > void RenderLayerCompositor::clearBackingForLayerIncludingDescendants(RenderLayer& layer) > { > if (layer.isComposited()) { >- removeFromScrollCoordinatedLayers(layer); >+ removeFromAsyncScrolledLayers(layer); > layer.clearBacking(); > } > >@@ -2786,7 +2786,7 @@ bool RenderLayerCompositor::isAsyncScrollableStickyLayer(const RenderLayer& laye > return false; > > // No overflow ancestor, so see if the frame supports async scrolling. >- if (hasCoordinatedScrolling()) >+ if (hasAsyncScrolling()) > return true; > > #if PLATFORM(IOS_FAMILY) >@@ -2833,9 +2833,9 @@ bool RenderLayerCompositor::fixedLayerIntersectsViewport(const RenderLayer& laye > return viewBounds.intersects(enclosingIntRect(absoluteBounds)); > } > >-bool RenderLayerCompositor::useCoordinatedScrollingForLayer(const RenderLayer& layer) const >+bool RenderLayerCompositor::useAsyncScrollingForLayer(const RenderLayer& layer) const > { >- if (layer.isRenderViewLayer() && hasCoordinatedScrolling()) >+ if (layer.isRenderViewLayer() && hasAsyncScrolling()) > return true; > > #if PLATFORM(IOS_FAMILY) >@@ -3430,7 +3430,7 @@ void RenderLayerCompositor::ensureRootLayer() > > updateOverflowControlsLayers(); > >- if (hasCoordinatedScrolling()) >+ if (hasAsyncScrolling()) > scheduleLayerFlush(true); > else > updateScrollLayerPosition(); >@@ -3639,43 +3639,43 @@ void RenderLayerCompositor::deviceOrPageScaleFactorChanged() > rootLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants(); > } > >-static bool canCoordinateScrollingForLayer(const RenderLayer& layer) >+static bool canUseAsyncScrollingForLayer(const RenderLayer& layer) > { > return (layer.isRenderViewLayer() || layer.parent()) && layer.isComposited(); > } > >-void RenderLayerCompositor::updateScrollCoordinatedStatus(RenderLayer& layer, OptionSet<ScrollingNodeChangeFlags> changes) >+void RenderLayerCompositor::updateAsyncScrollingStatus(RenderLayer& layer, OptionSet<ScrollingNodeChangeFlags> changes) > { >- OptionSet<ScrollCoordinationRole> coordinationRoles; >+ OptionSet<AsyncScrollingRole> asyncScrollingRoles; > if (isViewportConstrainedFixedOrStickyLayer(layer)) >- coordinationRoles.add(ScrollCoordinationRole::ViewportConstrained); >+ asyncScrollingRoles.add(AsyncScrollingRole::ViewportConstrained); > >- if (useCoordinatedScrollingForLayer(layer)) >- coordinationRoles.add(ScrollCoordinationRole::Scrolling); >+ if (useAsyncScrollingForLayer(layer)) >+ asyncScrollingRoles.add(AsyncScrollingRole::Scrolling); > > if (layer.isComposited()) >- layer.backing()->setIsScrollCoordinatedWithViewportConstrainedRole(coordinationRoles.contains(ScrollCoordinationRole::ViewportConstrained)); >+ layer.backing()->setIsAsyncScrolledWithViewportConstrainedRole(asyncScrollingRoles.contains(AsyncScrollingRole::ViewportConstrained)); > >- if (coordinationRoles && canCoordinateScrollingForLayer(layer)) { >- if (m_scrollCoordinatedLayers.add(&layer).isNewEntry) >+ if (asyncScrollingRoles && canUseAsyncScrollingForLayer(layer)) { >+ if (m_asyncScrolledLayers.add(&layer).isNewEntry) > m_subframeScrollLayersNeedReattach = true; > >- updateScrollCoordinatedLayer(layer, coordinationRoles, changes); >+ updateAsyncScrolledLayer(layer, asyncScrollingRoles, changes); > } else >- removeFromScrollCoordinatedLayers(layer); >+ removeFromAsyncScrolledLayers(layer); > } > >-void RenderLayerCompositor::removeFromScrollCoordinatedLayers(RenderLayer& layer) >+void RenderLayerCompositor::removeFromAsyncScrolledLayers(RenderLayer& layer) > { >- if (!m_scrollCoordinatedLayers.contains(&layer)) >+ if (!m_asyncScrolledLayers.contains(&layer)) > return; > > m_subframeScrollLayersNeedReattach = true; > >- m_scrollCoordinatedLayers.remove(&layer); >- m_scrollCoordinatedLayersNeedingUpdate.remove(&layer); >+ m_asyncScrolledLayers.remove(&layer); >+ m_asyncScrolledLayersNeedingUpdate.remove(&layer); > >- detachScrollCoordinatedLayer(layer, { ScrollCoordinationRole::Scrolling, ScrollCoordinationRole::ViewportConstrained }); >+ detachAsyncScrolledLayer(layer, { AsyncScrollingRole::Scrolling, AsyncScrollingRole::ViewportConstrained }); > } > > FixedPositionViewportConstraints RenderLayerCompositor::computeFixedViewportConstraints(RenderLayer& layer) const >@@ -3749,7 +3749,7 @@ static ScrollingNodeID enclosingScrollingNodeID(RenderLayer& layer, IncludeSelfO > return 0; > } > >-static ScrollingNodeID scrollCoordinatedAncestorInParentOfFrame(Frame& frame) >+static ScrollingNodeID asyncScrolledAncestorInParentOfFrame(Frame& frame) > { > if (!frame.document() || !frame.view()) > return 0; >@@ -3786,7 +3786,7 @@ void RenderLayerCompositor::reattachSubframeScrollLayers() > if (!frameScrollingNodeID) > continue; > >- ScrollingNodeID parentNodeID = scrollCoordinatedAncestorInParentOfFrame(*child); >+ ScrollingNodeID parentNodeID = asyncScrolledAncestorInParentOfFrame(*child); > if (!parentNodeID) > continue; > >@@ -3794,19 +3794,19 @@ void RenderLayerCompositor::reattachSubframeScrollLayers() > } > } > >-static inline ScrollCoordinationRole scrollCoordinationRoleForNodeType(ScrollingNodeType nodeType) >+static inline AsyncScrollingRole asyncScrollingRoleForNodeType(ScrollingNodeType nodeType) > { > switch (nodeType) { > case ScrollingNodeType::MainFrame: > case ScrollingNodeType::Subframe: > case ScrollingNodeType::Overflow: >- return ScrollCoordinationRole::Scrolling; >+ return AsyncScrollingRole::Scrolling; > case ScrollingNodeType::Fixed: > case ScrollingNodeType::Sticky: >- return ScrollCoordinationRole::ViewportConstrained; >+ return AsyncScrollingRole::ViewportConstrained; > } > ASSERT_NOT_REACHED(); >- return ScrollCoordinationRole::Scrolling; >+ return AsyncScrollingRole::Scrolling; > } > > ScrollingNodeID RenderLayerCompositor::attachScrollingNode(RenderLayer& layer, ScrollingNodeType nodeType, ScrollingNodeID parentNodeID) >@@ -3818,7 +3818,7 @@ ScrollingNodeID RenderLayerCompositor::attachScrollingNode(RenderLayer& layer, S > if (!backing) > return 0; > >- ScrollCoordinationRole role = scrollCoordinationRoleForNodeType(nodeType); >+ AsyncScrollingRole role = asyncScrollingRoleForNodeType(nodeType); > ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(role); > if (!nodeID) > nodeID = scrollingCoordinator->uniqueScrollingNodeID(); >@@ -3833,26 +3833,26 @@ ScrollingNodeID RenderLayerCompositor::attachScrollingNode(RenderLayer& layer, S > return nodeID; > } > >-void RenderLayerCompositor::detachScrollCoordinatedLayer(RenderLayer& layer, OptionSet<ScrollCoordinationRole> roles) >+void RenderLayerCompositor::detachAsyncScrolledLayer(RenderLayer& layer, OptionSet<AsyncScrollingRole> roles) > { > auto* backing = layer.backing(); > if (!backing) > return; > >- if (roles.contains(ScrollCoordinationRole::Scrolling)) { >- if (ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(ScrollCoordinationRole::Scrolling)) >+ if (roles.contains(AsyncScrollingRole::Scrolling)) { >+ if (ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(AsyncScrollingRole::Scrolling)) > m_scrollingNodeToLayerMap.remove(nodeID); > } > >- if (roles.contains(ScrollCoordinationRole::ViewportConstrained)) { >- if (ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(ScrollCoordinationRole::ViewportConstrained)) >+ if (roles.contains(AsyncScrollingRole::ViewportConstrained)) { >+ if (ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(AsyncScrollingRole::ViewportConstrained)) > m_scrollingNodeToLayerMap.remove(nodeID); > } > > backing->detachFromScrollingCoordinator(roles); > } > >-void RenderLayerCompositor::updateScrollCoordinationForThisFrame(ScrollingNodeID parentNodeID) >+void RenderLayerCompositor::updateAsyncScrollingForThisFrame(ScrollingNodeID parentNodeID) > { > auto* scrollingCoordinator = this->scrollingCoordinator(); > FrameView& frameView = m_renderView.frameView(); >@@ -3872,11 +3872,11 @@ void RenderLayerCompositor::updateScrollCoordinationForThisFrame(ScrollingNodeID > scrollingCoordinator->updateFrameScrollingNode(nodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), clipLayer(), scrollingGeometry); > } > >-void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, OptionSet<ScrollCoordinationRole> roles, OptionSet<ScrollingNodeChangeFlags> changes) >+void RenderLayerCompositor::updateAsyncScrolledLayer(RenderLayer& layer, OptionSet<AsyncScrollingRole> roles, OptionSet<ScrollingNodeChangeFlags> changes) > { > bool isRenderViewLayer = layer.isRenderViewLayer(); > >- ASSERT(m_scrollCoordinatedLayers.contains(&layer)); >+ ASSERT(m_asyncScrolledLayers.contains(&layer)); > ASSERT(layer.isComposited()); > > auto* scrollingCoordinator = this->scrollingCoordinator(); >@@ -3884,12 +3884,12 @@ void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, Opt > return; > > if (!m_renderView.frame().isMainFrame()) { >- ScrollingNodeID parentDocumentHostingNodeID = scrollCoordinatedAncestorInParentOfFrame(m_renderView.frame()); >+ ScrollingNodeID parentDocumentHostingNodeID = asyncScrolledAncestorInParentOfFrame(m_renderView.frame()); > if (!parentDocumentHostingNodeID) > return; > >- updateScrollCoordinationForThisFrame(parentDocumentHostingNodeID); >- if (!(roles.contains(ScrollCoordinationRole::ViewportConstrained)) && isRenderViewLayer) >+ updateAsyncScrollingForThisFrame(parentDocumentHostingNodeID); >+ if (!(roles.contains(AsyncScrollingRole::ViewportConstrained)) && isRenderViewLayer) > return; > } > >@@ -3901,7 +3901,7 @@ void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, Opt > > // Always call this even if the backing is already attached because the parent may have changed. > // If a node plays both roles, fixed/sticky is always the ancestor node of scrolling. >- if (roles.contains(ScrollCoordinationRole::ViewportConstrained)) { >+ if (roles.contains(AsyncScrollingRole::ViewportConstrained)) { > ScrollingNodeType nodeType = ScrollingNodeType::MainFrame; > if (layer.renderer().isFixedPositioned()) > nodeType = ScrollingNodeType::Fixed; >@@ -3936,11 +3936,11 @@ void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, Opt > > parentNodeID = nodeID; > } else >- detachScrollCoordinatedLayer(layer, ScrollCoordinationRole::ViewportConstrained); >+ detachAsyncScrolledLayer(layer, AsyncScrollingRole::ViewportConstrained); > >- if (roles.contains(ScrollCoordinationRole::Scrolling)) { >+ if (roles.contains(AsyncScrollingRole::Scrolling)) { > if (isRenderViewLayer) >- updateScrollCoordinationForThisFrame(parentNodeID); >+ updateAsyncScrollingForThisFrame(parentNodeID); > else { > ScrollingNodeType nodeType = ScrollingNodeType::Overflow; > ScrollingNodeID nodeID = attachScrollingNode(layer, nodeType, parentNodeID); >@@ -3972,7 +3972,7 @@ void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, Opt > scrollingCoordinator->updateOverflowScrollingNode(nodeID, backing->scrollingLayer(), backing->scrollingContentsLayer(), scrollingGeometry); > } > } else >- detachScrollCoordinatedLayer(layer, ScrollCoordinationRole::Scrolling); >+ detachAsyncScrolledLayer(layer, AsyncScrollingRole::Scrolling); > } > > ScrollableArea* RenderLayerCompositor::scrollableAreaForScrollLayerID(ScrollingNodeID nodeID) const >@@ -3986,7 +3986,7 @@ ScrollableArea* RenderLayerCompositor::scrollableAreaForScrollLayerID(ScrollingN > void RenderLayerCompositor::willRemoveScrollingLayerWithBacking(RenderLayer& layer, RenderLayerBacking& backing) > { > if (auto* scrollingCoordinator = this->scrollingCoordinator()) { >- backing.detachFromScrollingCoordinator(ScrollCoordinationRole::Scrolling); >+ backing.detachFromScrollingCoordinator(AsyncScrollingRole::Scrolling); > > // For Coordinated Graphics. > scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer); >@@ -4002,7 +4002,7 @@ void RenderLayerCompositor::willRemoveScrollingLayerWithBacking(RenderLayer& lay > > void RenderLayerCompositor::didAddScrollingLayer(RenderLayer& layer) > { >- updateScrollCoordinatedStatus(layer, { ScrollingNodeChangeFlags::Layer, ScrollingNodeChangeFlags::LayerGeometry }); >+ updateAsyncScrollingStatus(layer, { ScrollingNodeChangeFlags::Layer, ScrollingNodeChangeFlags::LayerGeometry }); > > if (auto* scrollingCoordinator = this->scrollingCoordinator()) { > // For Coordinated Graphics. >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.h b/Source/WebCore/rendering/RenderLayerCompositor.h >index 0f7a0878843..4402ad9c043 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.h >+++ b/Source/WebCore/rendering/RenderLayerCompositor.h >@@ -83,7 +83,7 @@ enum class CompositingReason { > EmbeddedView = 1 << 26, > }; > >-enum class ScrollCoordinationRole { >+enum class AsyncScrollingRole { > ViewportConstrained = 1 << 0, > Scrolling = 1 << 1 > }; >@@ -322,8 +322,8 @@ public: > LayerGeometry = 1 << 1, > }; > >- void updateScrollCoordinatedStatus(RenderLayer&, OptionSet<ScrollingNodeChangeFlags>); >- void removeFromScrollCoordinatedLayers(RenderLayer&); >+ void updateAsyncScrollingStatus(RenderLayer&, OptionSet<ScrollingNodeChangeFlags>); >+ void removeFromAsyncScrolledLayers(RenderLayer&); > > void willRemoveScrollingLayerWithBacking(RenderLayer&, RenderLayerBacking&); > void didAddScrollingLayer(RenderLayer&); >@@ -437,8 +437,8 @@ private: > > void notifyIFramesOfCompositingChange(); > >- void updateScrollCoordinatedLayersAfterFlushIncludingSubframes(); >- void updateScrollCoordinatedLayersAfterFlush(); >+ void updateAsyncScrolledLayersAfterFlushIncludingSubframes(); >+ void updateAsyncScrolledLayersAfterFlush(); > > FloatRect visibleRectForLayerFlushing() const; > >@@ -473,10 +473,10 @@ private: > > void updateCustomLayersAfterFlush(); > >- void updateScrollCoordinationForThisFrame(ScrollingNodeID); >+ void updateAsyncScrollingForThisFrame(ScrollingNodeID); > ScrollingNodeID attachScrollingNode(RenderLayer&, ScrollingNodeType, ScrollingNodeID parentNodeID); >- void updateScrollCoordinatedLayer(RenderLayer&, OptionSet<ScrollCoordinationRole>, OptionSet<ScrollingNodeChangeFlags>); >- void detachScrollCoordinatedLayer(RenderLayer&, OptionSet<ScrollCoordinationRole>); >+ void updateAsyncScrolledLayer(RenderLayer&, OptionSet<AsyncScrollingRole>, OptionSet<ScrollingNodeChangeFlags>); >+ void detachAsyncScrolledLayer(RenderLayer&, OptionSet<AsyncScrollingRole>); > void reattachSubframeScrollLayers(); > > FixedPositionViewportConstraints computeFixedViewportConstraints(RenderLayer&) const; >@@ -491,11 +491,10 @@ private: > bool requiresContentShadowLayer() const; > #endif > >- // True if the FrameView uses a ScrollingCoordinator. >- bool hasCoordinatedScrolling() const; >- bool useCoordinatedScrollingForLayer(const RenderLayer&) const; >+ // True if the FrameView uses async scrolling. >+ bool hasAsyncScrolling() const; >+ bool useAsyncScrollingForLayer(const RenderLayer&) const; > >- // FIXME: make the coordinated/async terminology consistent. > bool isAsyncScrollableStickyLayer(const RenderLayer&, const RenderLayer** enclosingAcceleratedOverflowLayer = nullptr) const; > bool isViewportConstrainedFixedOrStickyLayer(const RenderLayer&) const; > >@@ -550,8 +549,8 @@ private: > RefPtr<GraphicsLayer> m_clipLayer; > RefPtr<GraphicsLayer> m_scrollLayer; > >- HashSet<RenderLayer*> m_scrollCoordinatedLayers; >- HashSet<RenderLayer*> m_scrollCoordinatedLayersNeedingUpdate; >+ HashSet<RenderLayer*> m_asyncScrolledLayers; >+ HashSet<RenderLayer*> m_asyncScrolledLayersNeedingUpdate; > > // Enclosing layer for overflow controls and the clipping layer > RefPtr<GraphicsLayer> m_overflowControlsHostLayer; >-- >2.20.1 >
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 193394
:
359024
|
359036