WebKit Bugzilla
Attachment 371726 Details for
Bug 198475
: [Nicosia] support async scrolling
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP
bug-198475-20190610090256.patch (text/plain), 59.08 KB, created by
Zan Dobersek
on 2019-06-10 00:02:57 PDT
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Zan Dobersek
Created:
2019-06-10 00:02:57 PDT
Size:
59.08 KB
patch
obsolete
>Subversion Revision: 246249 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fb5b50dea19d1d58f201b1c632e9e03b1cc9432c..764e65db9fbf676c875df29f841a667de5219461 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,72 @@ >+2019-06-10 Zan Dobersek <zdobersek@igalia.com> >+ >+ [Nicosia] support async scrolling >+ https://bugs.webkit.org/show_bug.cgi?id=198475 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests (OOPS!). >+ >+ * PlatformPlayStation.cmake: >+ * SourcesGTK.txt: >+ * SourcesWPE.txt: >+ * page/scrolling/ScrollingTreeScrollingNode.cpp: >+ (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren): >+ * page/scrolling/ScrollingTreeScrollingNode.h: >+ * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: >+ (WebCore::ScrollingCoordinatorNicosia::pageDestroyed): >+ (WebCore::ScrollingCoordinatorNicosia::commitTreeState): >+ * page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp: >+ (WebCore::LayerRepresentation::retainPlatformLayer): >+ (WebCore::LayerRepresentation::releasePlatformLayer): >+ * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: >+ (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren): >+ (WebCore::ScrollingTreeFixedNode::applyLayerPositions): >+ (WebCore::ScrollingTreeFixedNode::dumpProperties const): >+ * page/scrolling/nicosia/ScrollingTreeFixedNode.h: >+ * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: >+ (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren): >+ (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren): >+ (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent): >+ (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionScrollingLayers): >+ (WebCore::ScrollingTreeFrameScrollingNodeNicosia::applyLayerPositions): >+ * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: >+ * page/scrolling/nicosia/ScrollingTreeNicosia.cpp: >+ (WebCore::ScrollingTreeNicosia::createScrollingTreeNode): >+ * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp: Added. >+ (WebCore::ScrollingTreePositionedNode::create): >+ (WebCore::ScrollingTreePositionedNode::ScrollingTreePositionedNode): >+ (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren): >+ (WebCore::ScrollingTreePositionedNode::applyLayerPositions): >+ (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange): >+ (WebCore::ScrollingTreePositionedNode::dumpProperties const): >+ * page/scrolling/nicosia/ScrollingTreePositionedNode.h: Copied from Source/WebCore/page/scrolling/nicosia/ScrollingTreeStickyNode.h. >+ (WebCore::ScrollingTreePositionedNode::scrollPositioningBehavior const): >+ (WebCore::ScrollingTreePositionedNode::relatedOverflowScrollingNodes const): >+ * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp: >+ (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren): >+ (WebCore::ScrollingTreeStickyNode::applyLayerPositions): >+ (WebCore::ScrollingTreeStickyNode::dumpProperties const): >+ * page/scrolling/nicosia/ScrollingTreeStickyNode.h: >+ * platform/TextureMapper.cmake: >+ * platform/graphics/nicosia/NicosiaPlatformLayer.h: >+ (Nicosia::PlatformLayer::setSceneIntegration): >+ (Nicosia::PlatformLayer::createUpdateScope): >+ (Nicosia::CompositionLayer::accessStaging): >+ * platform/graphics/nicosia/NicosiaSceneIntegration.cpp: Copied from Source/WebCore/page/scrolling/nicosia/ScrollingTreeFixedNode.cpp. >+ (Nicosia::SceneIntegration::SceneIntegration): >+ (Nicosia::SceneIntegration::~SceneIntegration): >+ (Nicosia::SceneIntegration::setClient): >+ (Nicosia::SceneIntegration::invalidate): >+ (Nicosia::SceneIntegration::requestUpdate): >+ (Nicosia::SceneIntegration::createUpdateScope): >+ (Nicosia::SceneIntegration::UpdateScope::UpdateScope): >+ (Nicosia::SceneIntegration::UpdateScope::~UpdateScope): >+ * platform/graphics/nicosia/NicosiaSceneIntegration.h: Copied from Source/WebCore/page/scrolling/nicosia/ScrollingTreeStickyNode.h. >+ * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: >+ (WebCore::CoordinatedGraphicsLayer::platformLayer const): >+ * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: >+ > 2019-06-09 Rob Buis <rbuis@igalia.com> > > Add wildcard to Access-Control-Allow-Methods and Access-Control-Allow-Headers >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index e968451353ad6905736a12176046f44199f99994..15b6b9f575e92f4c3de3c1b27dc91ed3dcca4425 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,25 @@ >+2019-06-10 Zan Dobersek <zdobersek@igalia.com> >+ >+ [Nicosia] support async scrolling >+ https://bugs.webkit.org/show_bug.cgi?id=198475 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: >+ (WebKit::ThreadedCompositor::updateScene): >+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: >+ * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: >+ (WebKit::CompositingCoordinator::createGraphicsLayer): >+ * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: >+ * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: >+ (WebKit::DrawingAreaCoordinatedGraphics::supportsAsyncScrolling): >+ * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: >+ * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: >+ (WebKit::LayerTreeHost::LayerTreeHost): >+ (WebKit::LayerTreeHost::sceneIntegration): >+ (WebKit::LayerTreeHost::requestUpdate): >+ * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: >+ > 2019-06-09 Brent Fulgham <bfulgham@apple.com> > > [iOS] ResourceLoadStatistics state is not properly relayed to the NetworkProcess >diff --git a/Source/WebCore/PlatformPlayStation.cmake b/Source/WebCore/PlatformPlayStation.cmake >index 7193bc5ae10b24726ef89ef97e039d6e40f8c65d..d968e6c64e2bf921c0ee3f10912b06df35fbe759 100644 >--- a/Source/WebCore/PlatformPlayStation.cmake >+++ b/Source/WebCore/PlatformPlayStation.cmake >@@ -21,6 +21,7 @@ list(APPEND WebCore_SOURCES > page/scrolling/nicosia/ScrollingTreeFixedNode.cpp > page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp > page/scrolling/nicosia/ScrollingTreeNicosia.cpp >+ page/scrolling/nicosia/ScrollingTreePositionedNode.cpp > page/scrolling/nicosia/ScrollingTreeStickyNode.cpp > > page/scrolling/generic/ScrollingThreadGeneric.cpp >diff --git a/Source/WebCore/SourcesGTK.txt b/Source/WebCore/SourcesGTK.txt >index 9ce669a558b06de114ccb7662f22f61e9b8ef030..30f80af9431500391927beea251bbe104dbe37ce 100644 >--- a/Source/WebCore/SourcesGTK.txt >+++ b/Source/WebCore/SourcesGTK.txt >@@ -51,6 +51,7 @@ page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp > page/scrolling/nicosia/ScrollingTreeFixedNode.cpp > page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp > page/scrolling/nicosia/ScrollingTreeNicosia.cpp >+page/scrolling/nicosia/ScrollingTreePositionedNode.cpp > page/scrolling/nicosia/ScrollingTreeStickyNode.cpp > > page/scrolling/generic/ScrollingThreadGeneric.cpp >diff --git a/Source/WebCore/SourcesWPE.txt b/Source/WebCore/SourcesWPE.txt >index dbbd995ae492848629db393e1995ddc5de851105..f0762f32be6a91abceaa9a97c4fc497ece18511c 100644 >--- a/Source/WebCore/SourcesWPE.txt >+++ b/Source/WebCore/SourcesWPE.txt >@@ -52,6 +52,7 @@ page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp > page/scrolling/nicosia/ScrollingTreeFixedNode.cpp > page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp > page/scrolling/nicosia/ScrollingTreeNicosia.cpp >+page/scrolling/nicosia/ScrollingTreePositionedNode.cpp > page/scrolling/nicosia/ScrollingTreeStickyNode.cpp > > page/scrolling/generic/ScrollingThreadGeneric.cpp >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >index 51b356a941f713a314fc0182ffdc4c4a60333194..0b2a7e240e3f90e729f9d55133dd157218acea96 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >@@ -34,6 +34,10 @@ > #include "ScrollingTree.h" > #include <wtf/text/TextStream.h> > >+#if USE(NICOSIA) >+#include "NicosiaPlatformLayer.h" >+#endif >+ > namespace WebCore { > > ScrollingTreeScrollingNode::ScrollingTreeScrollingNode(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID) >@@ -97,7 +101,7 @@ void ScrollingTreeScrollingNode::commitStateBeforeChildren(const ScrollingStateN > if (state.hasChangedProperty(ScrollingStateScrollingNode::ExpectsWheelEventTestTrigger)) > m_expectsWheelEventTestTrigger = state.expectsWheelEventTestTrigger(); > >-#if PLATFORM(COCOA) >+#if PLATFORM(COCOA) || USE(NICOSIA) > if (state.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) > m_scrollContainerLayer = state.scrollContainerLayer(); > >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h >index b4340288d06d2864901ac257a4300bdfde61c1e1..eb54ed1eb3bd6112b2497c04f1b5d484017e3d7a 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h >+++ b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h >@@ -28,6 +28,7 @@ > #if ENABLE(ASYNC_SCROLLING) > > #include "IntRect.h" >+#include "PlatformLayer.h" > #include "ScrollSnapOffsetsInfo.h" > #include "ScrollTypes.h" > #include "ScrollingCoordinator.h" >@@ -128,6 +129,9 @@ protected: > > bool expectsWheelEventTestTrigger() const { return m_expectsWheelEventTestTrigger; } > >+ PlatformLayer* scrollContainerLayer() const { return m_scrollContainerLayer.get(); } >+ PlatformLayer* scrolledContentsLayer() const { return m_scrolledContentsLayer.get(); } >+ > LayoutPoint parentToLocalPoint(LayoutPoint) const override; > LayoutPoint localToContentsPoint(LayoutPoint) const override; > >@@ -153,6 +157,9 @@ private: > #if PLATFORM(COCOA) > RetainPtr<CALayer> m_scrollContainerLayer; > RetainPtr<CALayer> m_scrolledContentsLayer; >+#elif USE(NICOSIA) >+ RefPtr<Nicosia::PlatformLayer> m_scrollContainerLayer; >+ RefPtr<Nicosia::PlatformLayer> m_scrolledContentsLayer; > #endif > }; > >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp b/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp >index 0d343ab64085a1eba90fb3da15265336e4006fd4..470ae5a6d9b89f00b88fa5f98ccff4f58699b525 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp >@@ -58,7 +58,9 @@ void ScrollingCoordinatorNicosia::pageDestroyed() > > m_scrollingStateTreeCommitterTimer.stop(); > >- releaseScrollingTree(); >+ // Invalidating the scrolling tree will break the reference cycle between the ScrollingCoordinator and ScrollingTree objects. >+ RefPtr<ThreadedScrollingTree> scrollingTree = static_pointer_cast<ThreadedScrollingTree>(releaseScrollingTree()); >+ ScrollingThread::dispatch([scrollingTree] { scrollingTree->invalidate(); }); > } > > void ScrollingCoordinatorNicosia::commitTreeStateIfNeeded() >@@ -80,12 +82,16 @@ void ScrollingCoordinatorNicosia::scheduleTreeStateCommit() > > void ScrollingCoordinatorNicosia::commitTreeState() > { >+ willCommitTree(); >+ > if (!scrollingStateTree()->hasChangedProperties()) > return; > > RefPtr<ThreadedScrollingTree> threadedScrollingTree = downcast<ThreadedScrollingTree>(scrollingTree()); > > auto treeState = scrollingStateTree()->commit(LayerRepresentation::PlatformLayerRepresentation); >+ threadedScrollingTree->incrementPendingCommitCount(); >+ > ScrollingThread::dispatch([threadedScrollingTree, treeState = WTFMove(treeState)]() mutable { > threadedScrollingTree->commitTreeState(WTFMove(treeState)); > }); >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp b/Source/WebCore/page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp >index b5328eb4372331839248b8a7c86f116716b118db..55c5e60596e59aa0003a7f37b0e22219e9adb533 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp >@@ -26,21 +26,23 @@ > #include "config.h" > #include "ScrollingStateNode.h" > >-#include "GraphicsLayer.h" >-#include "NotImplemented.h" >- > #if ENABLE(ASYNC_SCROLLING) && USE(NICOSIA) > >+#include "NicosiaPlatformLayer.h" >+#include "PlatformLayer.h" >+ > namespace WebCore { > >-void LayerRepresentation::retainPlatformLayer(void*) >+void LayerRepresentation::retainPlatformLayer(void* typelessLayer) > { >- notImplemented(); >+ if (auto* layer = makePlatformLayerTyped(typelessLayer)) >+ layer->ref(); > } > >-void LayerRepresentation::releasePlatformLayer(void*) >+void LayerRepresentation::releasePlatformLayer(void* typelessLayer) > { >- notImplemented(); >+ if (auto* layer = makePlatformLayerTyped(typelessLayer)) >+ layer->deref(); > } > > PlatformLayer* LayerRepresentation::makePlatformLayerTyped(void* typelessLayer) >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFixedNode.cpp b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFixedNode.cpp >index c90dbf81e28ad4b7764a498bd57bb9cb82074099..70211272c3e8bb10abf8ba37e8c6528e201c5aeb 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFixedNode.cpp >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFixedNode.cpp >@@ -30,7 +30,12 @@ > > #if ENABLE(ASYNC_SCROLLING) && USE(NICOSIA) > >+#include "Logging.h" >+#include "ScrollingStateFixedNode.h" > #include "ScrollingTree.h" >+#include "ScrollingTreeOverflowScrollingNode.h" >+#include "NicosiaPlatformLayer.h" >+#include <wtf/text/TextStream.h> > > namespace WebCore { > >@@ -50,12 +55,72 @@ ScrollingTreeFixedNode::~ScrollingTreeFixedNode() > scrollingTree().fixedOrStickyNodeRemoved(); > } > >-void ScrollingTreeFixedNode::commitStateBeforeChildren(const ScrollingStateNode&) >+void ScrollingTreeFixedNode::commitStateBeforeChildren(const ScrollingStateNode& stateNode) > { >+ auto& fixedStateNode = downcast<ScrollingStateFixedNode>(stateNode); >+ >+ if (fixedStateNode.hasChangedProperty(ScrollingStateNode::Layer)) { >+ Nicosia::PlatformLayer* layer = fixedStateNode.layer(); >+ m_scrollLayer = downcast<Nicosia::CompositionLayer>(layer); >+ } >+ >+ if (stateNode.hasChangedProperty(ScrollingStateFixedNode::ViewportConstraints)) >+ m_constraints = fixedStateNode.viewportConstraints(); > } > > void ScrollingTreeFixedNode::applyLayerPositions() > { >+ auto computeLayerPosition = [&] { >+ FloatSize overflowScrollDelta; >+ // FIXME: This code is wrong in complex cases where the fixed element is inside a positioned node as >+ // the scroll container order does not match the scrolling tree ancestor order. >+ for (auto* node = parent(); node; node = node->parent()) { >+ if (is<ScrollingTreeFrameScrollingNode>(*node)) { >+ // Fixed nodes are positioned relative to the containing frame scrolling node. >+ // We bail out after finding one. >+ auto layoutViewport = downcast<ScrollingTreeFrameScrollingNode>(*node).layoutViewport(); >+ return m_constraints.layerPositionForViewportRect(layoutViewport) - overflowScrollDelta; >+ } >+ >+ if (is<ScrollingTreeOverflowScrollingNode>(*node)) { >+ // To keep the layer still during async scrolling we adjust by how much the position has changed since layout. >+ auto& overflowNode = downcast<ScrollingTreeOverflowScrollingNode>(*node); >+ auto localDelta = overflowNode.lastCommittedScrollPosition() - overflowNode.currentScrollPosition(); >+ overflowScrollDelta += localDelta; >+ } >+ } >+ ASSERT_NOT_REACHED(); >+ return FloatPoint(); >+ }; >+ >+ auto layerPosition = computeLayerPosition(); >+ >+ LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeFixedNode " << scrollingNodeID() << " relatedNodeScrollPositionDidChange: viewportRectAtLastLayout " << m_constraints.viewportRectAtLastLayout() << " last layer pos " << m_constraints.layerPositionAtLastLayout() << " layerPosition " << layerPosition); >+ >+ ASSERT(m_scrollLayer); >+ m_scrollLayer->accessStaging( >+ [this, &layerPosition](Nicosia::CompositionLayer::LayerState& state) >+ { >+ state.position = layerPosition; >+ state.delta.positionChanged = true; >+ }); >+} >+ >+void ScrollingTreeFixedNode::dumpProperties(TextStream& ts, ScrollingStateTreeAsTextBehavior behavior) const >+{ >+ ts << "fixed node"; >+ ScrollingTreeNode::dumpProperties(ts, behavior); >+ ts.dumpProperty("fixed constraints", m_constraints); >+ >+#if 0 >+ if (behavior & ScrollingStateTreeAsTextBehaviorIncludeLayerPositions) { >+ FloatRect layerBounds = [m_layer bounds]; >+ FloatPoint anchorPoint = [m_layer anchorPoint]; >+ FloatPoint position = [m_layer position]; >+ FloatPoint layerTopLeft = position - toFloatSize(anchorPoint) * layerBounds.size() + m_constraints.alignmentOffset(); >+ ts.dumpProperty("layer top left", layerTopLeft); >+ } >+#endif > } > > } // namespace WebCore >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFixedNode.h b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFixedNode.h >index 9f8e1e251be22bed3b5b8ec0b2f9ff68621449d1..685d97ddd9c9ba759095a6a92de5b8a51e1fabcc 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFixedNode.h >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFixedNode.h >@@ -31,6 +31,13 @@ > > #include "ScrollingTreeNode.h" > >+#include "ScrollingConstraints.h" >+#include <wtf/RefPtr.h> >+ >+namespace Nicosia { >+class CompositionLayer; >+} >+ > namespace WebCore { > > class ScrollingTreeFixedNode final : public ScrollingTreeNode { >@@ -43,8 +50,15 @@ private: > > void commitStateBeforeChildren(const ScrollingStateNode&) override; > void applyLayerPositions() override; >+ >+ void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override; >+ >+ FixedPositionViewportConstraints m_constraints; >+ RefPtr<Nicosia::CompositionLayer> m_scrollLayer; > }; > > } // namespace WebCore > >+SPECIALIZE_TYPE_TRAITS_SCROLLING_NODE(ScrollingTreeFixedNode, isFixedNode()) >+ > #endif // ENABLE(ASYNC_SCROLLING) && USE(NICOSIA) >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp >index 1ce4a1adad81a4c115c1c9b89f7434aaaeab082a..e32f2ddb896e5715612964843eb89934ca6241ae 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp >@@ -30,6 +30,11 @@ > > #if ENABLE(ASYNC_SCROLLING) && USE(NICOSIA) > >+#include "FrameView.h" >+#include "ScrollingStateFrameScrollingNode.h" >+#include "ScrollingTree.h" >+#include "NicosiaPlatformLayer.h" >+ > namespace WebCore { > > Ref<ScrollingTreeFrameScrollingNode> ScrollingTreeFrameScrollingNodeNicosia::create(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID) >@@ -44,12 +49,91 @@ ScrollingTreeFrameScrollingNodeNicosia::ScrollingTreeFrameScrollingNodeNicosia(S > > ScrollingTreeFrameScrollingNodeNicosia::~ScrollingTreeFrameScrollingNodeNicosia() = default; > >-ScrollingEventResult ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent(const PlatformWheelEvent&) >+void ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren(const ScrollingStateNode& stateNode) >+{ >+ ScrollingTreeFrameScrollingNode::commitStateBeforeChildren(stateNode); >+ const auto& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(stateNode); >+ >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::Layer)) { >+ Nicosia::PlatformLayer* layer = scrollingStateNode.layer(); >+ m_scrollLayer = downcast<Nicosia::CompositionLayer>(layer); >+ } >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) { >+ Nicosia::PlatformLayer* layer = scrollingStateNode.scrolledContentsLayer(); >+ m_scrolledContentsLayer = downcast<Nicosia::CompositionLayer>(layer); >+ } >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer)) { >+ Nicosia::PlatformLayer* layer = scrollingStateNode.counterScrollingLayer(); >+ m_counterScrollingLayer = downcast<Nicosia::CompositionLayer>(layer); >+ } >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer)) { >+ Nicosia::PlatformLayer* layer = scrollingStateNode.insetClipLayer(); >+ m_insetClipLayer = downcast<Nicosia::CompositionLayer>(layer); >+ } >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer)) { >+ Nicosia::PlatformLayer* layer = scrollingStateNode.contentShadowLayer(); >+ m_contentShadowLayer = downcast<Nicosia::CompositionLayer>(layer); >+ } >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer)) { >+ Nicosia::PlatformLayer* layer = scrollingStateNode.headerLayer(); >+ m_headerLayer = downcast<Nicosia::CompositionLayer>(layer); >+ } >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer)) { >+ Nicosia::PlatformLayer* layer = scrollingStateNode.footerLayer(); >+ m_footerLayer = downcast<Nicosia::CompositionLayer>(layer); >+ } >+} >+ >+void ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren(const ScrollingStateNode& stateNode) >+{ >+ ScrollingTreeFrameScrollingNode::commitStateAfterChildren(stateNode); >+ >+ const auto& scrollingStateNode = downcast<ScrollingStateScrollingNode>(stateNode); >+ >+ // Update the scroll position after child nodes have been updated, because they need to have updated their constraints before any scrolling happens. >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) { >+ auto scrollType = scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll() ? ScrollType::Programmatic : ScrollType::User; >+ scrollTo(scrollingStateNode.requestedScrollPosition(), scrollType); >+ } >+} >+ >+ScrollingEventResult ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent(const PlatformWheelEvent& wheelEvent) > { >- return ScrollingEventResult::DidNotHandleEvent; >+ if (!canHaveScrollbars()) >+ return ScrollingEventResult::DidNotHandleEvent; >+ >+ if (wheelEvent.deltaX() || wheelEvent.deltaY()) { >+ auto* scrollLayer = scrolledContentsLayer(); >+ ASSERT(scrollLayer); >+ auto& compositionLayer = downcast<Nicosia::CompositionLayer>(*scrollLayer); >+ >+ auto updateScope = compositionLayer.createUpdateScope(); >+ scrollBy({ wheelEvent.deltaX(), -wheelEvent.deltaY() }); >+ } >+ >+ // TODO: >+ // scrollingTree().setOrClearLatchedNode(wheelEvent, scrollingNodeID()); >+ // scrollingTree().handleWheelEventPhase(wheelEvent.phase()); >+ return ScrollingEventResult::DidHandleEvent; > } > > void ScrollingTreeFrameScrollingNodeNicosia::repositionScrollingLayers() >+{ >+ auto* scrollLayer = scrolledContentsLayer(); >+ ASSERT(scrollLayer); >+ auto& compositionLayer = downcast<Nicosia::CompositionLayer>(*scrollLayer); >+ >+ auto scrollPosition = currentScrollPosition(); >+ >+ compositionLayer.accessStaging( >+ [&scrollPosition](Nicosia::CompositionLayer::LayerState& state) >+ { >+ state.position = -scrollPosition; >+ state.delta.positionChanged = true; >+ }); >+} >+ >+void ScrollingTreeFrameScrollingNodeNicosia::applyLayerPositions() > { > } > >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h >index 2b5a2be3bce0b5ee50ed906bc5e36478a202b186..f7b567eca744bdad889f9fd847b3ac36ed18489e 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h >@@ -31,6 +31,12 @@ > > #include "ScrollingTreeFrameScrollingNode.h" > >+#include <wtf/RefPtr.h> >+ >+namespace Nicosia { >+class CompositionLayer; >+} >+ > namespace WebCore { > > class ScrollingTreeFrameScrollingNodeNicosia final : public ScrollingTreeFrameScrollingNode { >@@ -41,9 +47,21 @@ public: > private: > ScrollingTreeFrameScrollingNodeNicosia(ScrollingTree&, ScrollingNodeType, ScrollingNodeID); > >+ void commitStateBeforeChildren(const ScrollingStateNode&) override; >+ void commitStateAfterChildren(const ScrollingStateNode&) override; >+ > ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) override; > > void repositionScrollingLayers() override; >+ void applyLayerPositions() override; >+ >+ RefPtr<Nicosia::CompositionLayer> m_scrollLayer; >+ RefPtr<Nicosia::CompositionLayer> m_scrolledContentsLayer; >+ RefPtr<Nicosia::CompositionLayer> m_counterScrollingLayer; >+ RefPtr<Nicosia::CompositionLayer> m_insetClipLayer; >+ RefPtr<Nicosia::CompositionLayer> m_contentShadowLayer; >+ RefPtr<Nicosia::CompositionLayer> m_headerLayer; >+ RefPtr<Nicosia::CompositionLayer> m_footerLayer; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeNicosia.cpp b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeNicosia.cpp >index cea7146f11809605c536ba778583f04fbc39a80d..97f886a680ebd5fd523051bf8d02afc20809eeb7 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeNicosia.cpp >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeNicosia.cpp >@@ -33,6 +33,7 @@ > #include "ScrollingTreeFixedNode.h" > #include "ScrollingTreeFrameHostingNode.h" > #include "ScrollingTreeFrameScrollingNodeNicosia.h" >+#include "ScrollingTreePositionedNode.h" > #include "ScrollingTreeStickyNode.h" > > namespace WebCore { >@@ -55,18 +56,18 @@ Ref<ScrollingTreeNode> ScrollingTreeNicosia::createScrollingTreeNode(ScrollingNo > return ScrollingTreeFrameScrollingNodeNicosia::create(*this, nodeType, nodeID); > case ScrollingNodeType::FrameHosting: > return ScrollingTreeFrameHostingNode::create(*this, nodeID); >- case ScrollingNodeType::Overflow: >- // Should not be reached -- caught by ASSERT_NOT_REACHED() below. >+ case ScrollingNodeType::Overflow: // FIXME > break; > case ScrollingNodeType::Fixed: > return ScrollingTreeFixedNode::create(*this, nodeID); > case ScrollingNodeType::Sticky: > return ScrollingTreeStickyNode::create(*this, nodeID); > case ScrollingNodeType::Positioned: >- RELEASE_ASSERT_NOT_REACHED(); >+ return ScrollingTreePositionedNode::create(*this, nodeID); > } > >- RELEASE_ASSERT_NOT_REACHED(); >+ // FIXME: ASSERT_NOT_REACHED(); >+ return ScrollingTreeFixedNode::create(*this, nodeID); > } > > } // namespace WebCore >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingTreePositionedNode.cpp b/Source/WebCore/page/scrolling/nicosia/ScrollingTreePositionedNode.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..8cbc04ecb77568e6b36f9ff9c1dbb42812d2dbcb >--- /dev/null >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingTreePositionedNode.cpp >@@ -0,0 +1,136 @@ >+/* >+ * Copyright (C) 2018 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above >+ * copyright notice, this list of conditions and the following >+ * disclaimer in the documentation and/or other materials provided >+ * with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "ScrollingTreePositionedNode.h" >+ >+#if ENABLE(ASYNC_SCROLLING) && USE(NICOSIA) >+ >+#include "Logging.h" >+#include "ScrollingStatePositionedNode.h" >+#include <wtf/text/TextStream.h> >+ >+namespace WebCore { >+ >+Ref<ScrollingTreePositionedNode> ScrollingTreePositionedNode::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID) >+{ >+ return adoptRef(*new ScrollingTreePositionedNode(scrollingTree, nodeID)); >+} >+ >+ScrollingTreePositionedNode::ScrollingTreePositionedNode(ScrollingTree& scrollingTree, ScrollingNodeID nodeID) >+ : ScrollingTreeNode(scrollingTree, ScrollingNodeType::Positioned, nodeID) >+{ >+} >+ >+ScrollingTreePositionedNode::~ScrollingTreePositionedNode() = default; >+ >+void ScrollingTreePositionedNode::commitStateBeforeChildren(const ScrollingStateNode& stateNode) >+{ >+ const ScrollingStatePositionedNode& positionedStateNode = downcast<ScrollingStatePositionedNode>(stateNode); >+ >+ if (positionedStateNode.hasChangedProperty(ScrollingStateNode::Layer)) { >+ Nicosia::PlatformLayer* layer = positionedStateNode.layer(); >+ m_scrollLayer = downcast<Nicosia::CompositionLayer>(layer); >+ } >+ >+ if (positionedStateNode.hasChangedProperty(ScrollingStatePositionedNode::RelatedOverflowScrollingNodes)) >+ m_relatedOverflowScrollingNodes = positionedStateNode.relatedOverflowScrollingNodes(); >+ >+ if (positionedStateNode.hasChangedProperty(ScrollingStatePositionedNode::LayoutConstraintData)) >+ m_constraints = positionedStateNode.layoutConstraints(); >+ >+ // Tell the ScrollingTree about non-ancestor overflow nodes which affect this node. >+ if (m_constraints.scrollPositioningBehavior() == ScrollPositioningBehavior::Moves) { >+ auto& relatedNodes = scrollingTree().overflowRelatedNodes(); >+ for (auto overflowNodeID : m_relatedOverflowScrollingNodes) { >+ relatedNodes.ensure(overflowNodeID, [] { >+ return Vector<ScrollingNodeID>(); >+ }).iterator->value.append(scrollingNodeID()); >+ } >+ } >+ if (!m_relatedOverflowScrollingNodes.isEmpty() && m_constraints.scrollPositioningBehavior() != ScrollPositioningBehavior::None) >+ scrollingTree().positionedNodesWithRelatedOverflow().add(scrollingNodeID()); >+} >+ >+void ScrollingTreePositionedNode::applyLayerPositions() >+{ >+ FloatSize scrollOffsetSinceLastCommit; >+ for (auto nodeID : m_relatedOverflowScrollingNodes) { >+ if (auto* node = scrollingTree().nodeForID(nodeID)) { >+ if (is<ScrollingTreeOverflowScrollingNode>(node)) { >+ auto& overflowNode = downcast<ScrollingTreeOverflowScrollingNode>(*node); >+ scrollOffsetSinceLastCommit += overflowNode.lastCommittedScrollPosition() - overflowNode.currentScrollPosition(); >+ } >+ } >+ } >+ auto layerOffset = -scrollOffsetSinceLastCommit; >+ if (m_constraints.scrollPositioningBehavior() == ScrollPositioningBehavior::Stationary) { >+ // Stationary nodes move in the opposite direction. >+ layerOffset = -layerOffset; >+ } >+ >+ FloatPoint layerPosition = m_constraints.layerPositionAtLastLayout() - layerOffset; >+ >+ LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreePositionedNode " << scrollingNodeID() << " applyLayerPositions: overflow delta " << scrollOffsetSinceLastCommit << " moving layer to " << layerPosition); >+ >+ m_scrollLayer->accessStaging( >+ [this, &layerPosition](Nicosia::CompositionLayer::LayerState& state) >+ { >+ state.position = layerPosition; >+ state.delta.positionChanged = true; >+ }); >+} >+ >+void ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange(const ScrollingTreeScrollingNode& changedNode) >+{ >+ if (!m_relatedOverflowScrollingNodes.contains(changedNode.scrollingNodeID())) >+ return; >+ >+ applyLayerPositions(); >+} >+ >+void ScrollingTreePositionedNode::dumpProperties(TextStream& ts, ScrollingStateTreeAsTextBehavior behavior) const >+{ >+ ts << "positioned node"; >+ ScrollingTreeNode::dumpProperties(ts, behavior); >+ >+ ts.dumpProperty("layout constraints", m_constraints); >+ ts.dumpProperty("related overflow nodes", m_relatedOverflowScrollingNodes.size()); >+ >+ if (behavior & ScrollingStateTreeAsTextBehaviorIncludeNodeIDs) { >+ if (!m_relatedOverflowScrollingNodes.isEmpty()) { >+ TextStream::GroupScope scope(ts); >+ ts << "overflow nodes"; >+ for (auto nodeID : m_relatedOverflowScrollingNodes) >+ ts << "\n" << indent << "nodeID " << nodeID; >+ } >+ } >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(ASYNC_SCROLLING) && USE(NICOSIA) >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingTreePositionedNode.h b/Source/WebCore/page/scrolling/nicosia/ScrollingTreePositionedNode.h >new file mode 100644 >index 0000000000000000000000000000000000000000..6951a1fcd065ed56305026964c0f8d16b04564a1 >--- /dev/null >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingTreePositionedNode.h >@@ -0,0 +1,69 @@ >+/* >+ * Copyright (C) 2018 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above >+ * copyright notice, this list of conditions and the following >+ * disclaimer in the documentation and/or other materials provided >+ * with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(ASYNC_SCROLLING) && USE(NICOSIA) >+ >+#include "ScrollingConstraints.h" >+#include "ScrollingTreeNode.h" >+#include <wtf/RefPtr.h> >+ >+namespace Nicosia { >+class CompositionLayer; >+} >+ >+namespace WebCore { >+ >+class ScrollingTreePositionedNode : public ScrollingTreeNode { >+public: >+ static Ref<ScrollingTreePositionedNode> create(ScrollingTree&, ScrollingNodeID); >+ virtual ~ScrollingTreePositionedNode(); >+ >+ ScrollPositioningBehavior scrollPositioningBehavior() const { return m_constraints.scrollPositioningBehavior(); } >+ const Vector<ScrollingNodeID>& relatedOverflowScrollingNodes() const { return m_relatedOverflowScrollingNodes; } >+ >+private: >+ ScrollingTreePositionedNode(ScrollingTree&, ScrollingNodeID); >+ >+ void commitStateBeforeChildren(const ScrollingStateNode&) override; >+ void relatedNodeScrollPositionDidChange(const ScrollingTreeScrollingNode& changedNode) override; >+ >+ void applyLayerPositions() override; >+ >+ void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override; >+ >+ Vector<ScrollingNodeID> m_relatedOverflowScrollingNodes; >+ LayoutConstraints m_constraints; >+ RefPtr<Nicosia::CompositionLayer> m_scrollLayer; >+}; >+ >+} // namespace WebCore >+ >+SPECIALIZE_TYPE_TRAITS_SCROLLING_NODE(ScrollingTreePositionedNode, isPositionedNode()) >+ >+#endif // ENABLE(ASYNC_SCROLLING) && USE(NICOSIA) >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeStickyNode.cpp b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeStickyNode.cpp >index d63eaaecf2c0f35158491544bf6decaeb5a31eb3..320e9150fa966387d68db9f870de984e3cdf30f3 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeStickyNode.cpp >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeStickyNode.cpp >@@ -30,7 +30,13 @@ > > #if ENABLE(ASYNC_SCROLLING) && USE(NICOSIA) > >+#include "Logging.h" >+#include "ScrollingStateStickyNode.h" > #include "ScrollingTree.h" >+#include "ScrollingTreeFrameScrollingNode.h" >+#include "ScrollingTreeOverflowScrollingNode.h" >+#include "NicosiaPlatformLayer.h" >+#include <wtf/text/TextStream.h> > > namespace WebCore { > >@@ -50,12 +56,60 @@ ScrollingTreeStickyNode::~ScrollingTreeStickyNode() > scrollingTree().fixedOrStickyNodeRemoved(); > } > >-void ScrollingTreeStickyNode::commitStateBeforeChildren(const ScrollingStateNode&) >+void ScrollingTreeStickyNode::commitStateBeforeChildren(const ScrollingStateNode& stateNode) > { >+ auto& stickyStateNode = downcast<ScrollingStateStickyNode>(stateNode); >+ >+ if (stickyStateNode.hasChangedProperty(ScrollingStateNode::Layer)) { >+ Nicosia::PlatformLayer* layer = stickyStateNode.layer(); >+ m_scrollLayer = downcast<Nicosia::CompositionLayer>(layer); >+ } >+ >+ if (stateNode.hasChangedProperty(ScrollingStateStickyNode::ViewportConstraints)) >+ m_constraints = stickyStateNode.viewportConstraints(); > } > > void ScrollingTreeStickyNode::applyLayerPositions() > { >+ FloatRect constrainingRect; >+ >+ auto* enclosingScrollingNode = parent(); >+ if (is<ScrollingTreeOverflowScrollingNode>(enclosingScrollingNode)) >+ constrainingRect = FloatRect(downcast<ScrollingTreeOverflowScrollingNode>(*enclosingScrollingNode).currentScrollPosition(), m_constraints.constrainingRectAtLastLayout().size()); >+ else if (is<ScrollingTreeFrameScrollingNode>(enclosingScrollingNode)) >+ constrainingRect = downcast<ScrollingTreeFrameScrollingNode>(enclosingScrollingNode)->layoutViewport(); >+ else >+ return; >+ >+ FloatPoint layerPosition = m_constraints.layerPositionForConstrainingRect(constrainingRect) - m_constraints.alignmentOffset(); >+ >+ LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeStickyNode " << scrollingNodeID() << " constrainingRect " << constrainingRect << " constrainingRectAtLastLayout " << m_constraints.constrainingRectAtLastLayout() << " last layer pos " << m_constraints.layerPositionAtLastLayout() << " layerPosition " << layerPosition); >+ >+ ASSERT(m_scrollLayer); >+ m_scrollLayer->accessStaging( >+ [this, &layerPosition](Nicosia::CompositionLayer::LayerState& state) >+ { >+ state.position = layerPosition; >+ state.delta.positionChanged = true; >+ }); >+} >+ >+void ScrollingTreeStickyNode::dumpProperties(TextStream& ts, ScrollingStateTreeAsTextBehavior behavior) const >+{ >+ ts << "sticky node"; >+ >+ ScrollingTreeNode::dumpProperties(ts, behavior); >+ ts.dumpProperty("sticky constraints", m_constraints); >+ >+#if 0 >+ if (behavior & ScrollingStateTreeAsTextBehaviorIncludeLayerPositions) { >+ FloatRect layerBounds = [m_layer bounds]; >+ FloatPoint anchorPoint = [m_layer anchorPoint]; >+ FloatPoint position = [m_layer position]; >+ FloatPoint layerTopLeft = position - toFloatSize(anchorPoint) * layerBounds.size() + m_constraints.alignmentOffset(); >+ ts.dumpProperty("layer top left", layerTopLeft); >+ } >+#endif > } > > } // namespace WebCore >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeStickyNode.h b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeStickyNode.h >index a3d191ea9b9f7581c848e1d9a9bfc5ee53b593fa..f9521474128c91e8a1ea8972716274e3479189ae 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeStickyNode.h >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeStickyNode.h >@@ -31,6 +31,13 @@ > > #include "ScrollingTreeNode.h" > >+#include "ScrollingConstraints.h" >+#include <wtf/RefPtr.h> >+ >+namespace Nicosia { >+class CompositionLayer; >+} >+ > namespace WebCore { > > class ScrollingTreeStickyNode final : public ScrollingTreeNode { >@@ -44,8 +51,14 @@ private: > void commitStateBeforeChildren(const ScrollingStateNode&) override; > void applyLayerPositions() override; > >+ void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override; >+ >+ RefPtr<Nicosia::CompositionLayer> m_scrollLayer; >+ StickyPositionViewportConstraints m_constraints; > }; > > } // namespace WebCore > >+SPECIALIZE_TYPE_TRAITS_SCROLLING_NODE(ScrollingTreeStickyNode, isStickyNode()) >+ > #endif // ENABLE(ASYNC_SCROLLING) && USE(NICOSIA) >diff --git a/Source/WebCore/platform/TextureMapper.cmake b/Source/WebCore/platform/TextureMapper.cmake >index 28b7e177a10440ee213b0a3817af7ff8e1b05035..9198e20a14f6db1359c38b8cb91332c6b20209c3 100644 >--- a/Source/WebCore/platform/TextureMapper.cmake >+++ b/Source/WebCore/platform/TextureMapper.cmake >@@ -82,6 +82,7 @@ if (USE_COORDINATED_GRAPHICS) > platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp > platform/graphics/nicosia/NicosiaPlatformLayer.cpp > platform/graphics/nicosia/NicosiaScene.cpp >+ platform/graphics/nicosia/NicosiaSceneIntegration.cpp > > platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp > platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp >@@ -100,6 +101,7 @@ if (USE_COORDINATED_GRAPHICS) > platform/graphics/nicosia/NicosiaPaintingEngine.h > platform/graphics/nicosia/NicosiaPlatformLayer.h > platform/graphics/nicosia/NicosiaScene.h >+ platform/graphics/nicosia/NicosiaSceneIntegration.h > > platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h > platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.h >diff --git a/Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h b/Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h >index be3a5257a4b25aea521cc58b480304f802bd8040..01f6a9a994ecee4fa83241238e34eeb48596166c 100644 >--- a/Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h >+++ b/Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h >@@ -34,6 +34,7 @@ > #include "FloatPoint3D.h" > #include "FloatRect.h" > #include "FloatSize.h" >+#include "NicosiaSceneIntegration.h" > #include "TextureMapperAnimation.h" > #include "TransformationMatrix.h" > #include <wtf/Function.h> >@@ -53,6 +54,20 @@ public: > using LayerID = uint64_t; > LayerID id() const { return m_id; } > >+ void setSceneIntegration(RefPtr<SceneIntegration>&& sceneIntegration) >+ { >+ LockHolder locker(m_state.lock); >+ m_state.sceneIntegration = WTFMove(sceneIntegration); >+ } >+ >+ std::unique_ptr<SceneIntegration::UpdateScope> createUpdateScope() >+ { >+ LockHolder locker(m_state.lock); >+ if (m_state.sceneIntegration) >+ return m_state.sceneIntegration->createUpdateScope(); >+ return nullptr; >+ } >+ > protected: > explicit PlatformLayer(uint64_t); > >@@ -60,6 +75,7 @@ protected: > > struct { > Lock lock; >+ RefPtr<SceneIntegration> sceneIntegration; > } m_state; > }; > >@@ -256,6 +272,13 @@ public: > functor(m_state.committed); > } > >+ template<typename T> >+ void accessStaging(const T& functor) >+ { >+ LockHolder locker(PlatformLayer::m_state.lock); >+ functor(m_state.staging); >+ } >+ > template<typename T> > void accessCommitted(const T& functor) > { >diff --git a/Source/WebCore/platform/graphics/nicosia/NicosiaSceneIntegration.cpp b/Source/WebCore/platform/graphics/nicosia/NicosiaSceneIntegration.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..0af3df425e51dc62f99f8e9a5a9d61425d1d0c4b >--- /dev/null >+++ b/Source/WebCore/platform/graphics/nicosia/NicosiaSceneIntegration.cpp >@@ -0,0 +1,85 @@ >+/* >+ * Copyright (C) 2019 Metrological Group B.V. >+ * Copyright (C) 2019 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above >+ * copyright notice, this list of conditions and the following >+ * disclaimer in the documentation and/or other materials provided >+ * with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "NicosiaSceneIntegration.h" >+ >+namespace Nicosia { >+ >+SceneIntegration::SceneIntegration() = default; >+ >+SceneIntegration::SceneIntegration(Client& client) >+{ >+ m_client.object = &client; >+} >+ >+SceneIntegration::~SceneIntegration() >+{ >+ ASSERT(!m_client.object); >+} >+ >+void SceneIntegration::setClient(Client& client) >+{ >+ LockHolder locker(m_client.lock); >+ m_client.object = &client; >+} >+ >+void SceneIntegration::invalidate() >+{ >+ LockHolder locker(m_client.lock); >+ m_client.object = nullptr; >+} >+ >+void SceneIntegration::requestUpdate() >+{ >+ LockHolder locker(m_client.lock); >+ if (m_client.object) >+ m_client.object->requestUpdate(); >+} >+ >+std::unique_ptr<SceneIntegration::UpdateScope> SceneIntegration::createUpdateScope() >+{ >+ return std::make_unique<UpdateScope>(makeRef(*this)); >+} >+ >+SceneIntegration::Client::~Client() = default; >+ >+SceneIntegration::UpdateScope::UpdateScope(Ref<SceneIntegration>&& sceneIntegration) >+ : m_sceneIntegration(WTFMove(sceneIntegration)) >+ , m_locker(m_sceneIntegration->m_client.lock) >+{ >+} >+ >+SceneIntegration::UpdateScope::~UpdateScope() >+{ >+ auto& sceneIntegrationObj = m_sceneIntegration.get(); >+ if (sceneIntegrationObj.m_client.object) >+ sceneIntegrationObj.m_client.object->requestUpdate(); >+} >+ >+} // namespace Nicosia >diff --git a/Source/WebCore/platform/graphics/nicosia/NicosiaSceneIntegration.h b/Source/WebCore/platform/graphics/nicosia/NicosiaSceneIntegration.h >new file mode 100644 >index 0000000000000000000000000000000000000000..7af390ba51ca4bed7ba673227dafd37cc4ee1310 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/nicosia/NicosiaSceneIntegration.h >@@ -0,0 +1,75 @@ >+/* >+ * Copyright (C) 2019 Metrological Group B.V. >+ * Copyright (C) 2019 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above >+ * copyright notice, this list of conditions and the following >+ * disclaimer in the documentation and/or other materials provided >+ * with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include <memory> >+#include <wtf/Lock.h> >+#include <wtf/Ref.h> >+#include <wtf/ThreadSafeRefCounted.h> >+ >+namespace Nicosia { >+ >+class SceneIntegration : public ThreadSafeRefCounted<SceneIntegration> { >+public: >+ class Client { >+ public: >+ virtual ~Client(); >+ >+ virtual void requestUpdate() = 0; >+ }; >+ >+ SceneIntegration(); >+ SceneIntegration(Client&); >+ ~SceneIntegration(); >+ >+ void setClient(Client&); >+ void invalidate(); >+ >+ void requestUpdate(); >+ >+ class UpdateScope { >+ public: >+ UpdateScope(Ref<SceneIntegration>&&); >+ ~UpdateScope(); >+ >+ private: >+ Ref<SceneIntegration> m_sceneIntegration; >+ LockHolder m_locker; >+ }; >+ >+ std::unique_ptr<UpdateScope> createUpdateScope(); >+ >+private: >+ struct { >+ Lock lock; >+ Client* object { nullptr }; >+ } m_client; >+}; >+ >+} // namespace Nicosia >diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp >index a95382c9d747959cb0de24bbd9b261a1c1fc0e7d..7e65aa624058d5c57a700bef5dc293b04566753b 100644 >--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp >+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp >@@ -1206,6 +1206,11 @@ bool CoordinatedGraphicsLayer::usesContentsLayer() const > return m_nicosia.contentLayer || m_compositedImage; > } > >+PlatformLayer* CoordinatedGraphicsLayer::platformLayer() const >+{ >+ return m_nicosia.layer.get(); >+} >+ > } // namespace WebCore > > #endif // USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h >index b5177de8cec528866a1c80a8f69b5ca72dd2b2ec..ca89de50af5d2a9822c2594f7ef26b1e59dba44f 100644 >--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h >+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h >@@ -108,6 +108,10 @@ public: > void resumeAnimations() override; > bool usesContentsLayer() const override; > >+#if USE(NICOSIA) >+ PlatformLayer* platformLayer() const override; >+#endif >+ > void syncPendingStateChangesIncludingSubLayers(); > void updateContentBuffersIncludingSubLayers(); > >diff --git a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp >index 530da864898580a7a0a253fd193abadb93f3b3e6..4bf3ff6c84e1021bd7aaec2c0847fd6525f5f9be 100644 >--- a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp >+++ b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp >@@ -292,6 +292,11 @@ void ThreadedCompositor::updateSceneState(const CoordinatedGraphicsState& state) > m_compositingRunLoop->scheduleUpdate(); > } > >+void ThreadedCompositor::updateScene() >+{ >+ m_compositingRunLoop->scheduleUpdate(); >+} >+ > #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) > RefPtr<WebCore::DisplayRefreshMonitor> ThreadedCompositor::displayRefreshMonitor(PlatformDisplayID) > { >diff --git a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h >index 7e16738f30a5c8ac80607cc4c7f7db41bbe0ef9f..30b89d2d20700899bbf2a9cc25085421c9a95c99 100644 >--- a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h >+++ b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h >@@ -72,6 +72,7 @@ public: > void setViewportSize(const WebCore::IntSize&, float scale); > > void updateSceneState(const WebCore::CoordinatedGraphicsState&); >+ void updateScene(); > > void invalidate(); > >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp >index be640e9ccf334d5edd2d767598a321c2118c124b..e601df64ea3717574ce0e0519ba695843017686a 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp >@@ -235,7 +235,11 @@ Ref<GraphicsLayer> CompositingCoordinator::createGraphicsLayer(GraphicsLayer::Ty > { > auto layer = adoptRef(*new CoordinatedGraphicsLayer(layerType, client)); > layer->setCoordinator(this); >- m_nicosia.state.layers.add(layer->compositionLayer()); >+ { >+ auto& compositionLayer = layer->compositionLayer(); >+ m_nicosia.state.layers.add(compositionLayer); >+ compositionLayer->setSceneIntegration(m_client.sceneIntegration()); >+ } > m_registeredLayers.add(layer->id(), layer.ptr()); > layer->setNeedsVisibleRectAdjustment(); > notifyFlushRequired(layer.ptr()); >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h >index b4a0d1544d508080cf69dd66fdf96442e2c22a41..79ccccb1df48e18f83c6cee2c8fe579fb85edc14 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h >@@ -40,6 +40,7 @@ > > namespace Nicosia { > class PaintingEngine; >+class SceneIntegration; > } > > namespace WebCore { >@@ -60,6 +61,7 @@ public: > virtual void didFlushRootLayer(const WebCore::FloatRect& visibleContentRect) = 0; > virtual void notifyFlushRequired() = 0; > virtual void commitSceneState(const WebCore::CoordinatedGraphicsState&) = 0; >+ virtual RefPtr<Nicosia::SceneIntegration> sceneIntegration() = 0; > }; > > CompositingCoordinator(WebCore::Page*, CompositingCoordinator::Client&); >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp >index 072000e82c34e9f19d2abab5c38ac60d62b297b6..c206b3153824113d73ec3886bc4560f574f65d55 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp >@@ -257,6 +257,11 @@ void DrawingAreaCoordinatedGraphics::didChangeViewportAttributes(ViewportAttribu > m_previousLayerTreeHost->didChangeViewportAttributes(WTFMove(attrs)); > } > >+bool DrawingAreaCoordinatedGraphics::supportsAsyncScrolling() >+{ >+ return true; >+} >+ > GraphicsLayerFactory* DrawingAreaCoordinatedGraphics::graphicsLayerFactory() > { > if (!m_layerTreeHost) >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h >index e684f75d6456305604e689adbe54eec4c2a81539..19ece79e13fab108c1282f238b824e6201065c2b 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h >@@ -62,6 +62,8 @@ private: > void deviceOrPageScaleFactorChanged() override; > void didChangeViewportAttributes(WebCore::ViewportAttributes&&) override; > >+ bool supportsAsyncScrolling() override; >+ > WebCore::GraphicsLayerFactory* graphicsLayerFactory() override; > void setRootCompositingLayer(WebCore::GraphicsLayer*) override; > void scheduleInitialDeferredPaint() override { }; >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp >index e894bd161f0273c8878267bb594707722e3c3597..9bda82091ef94a63687f38f0a06aa70c433000dc 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp >@@ -53,6 +53,7 @@ LayerTreeHost::LayerTreeHost(WebPage& webPage) > , m_surface(AcceleratedSurface::create(webPage, *this)) > , m_viewportController(webPage.size()) > , m_layerFlushTimer(RunLoop::main(), this, &LayerTreeHost::layerFlushTimerFired) >+ , m_sceneIntegration(*new Nicosia::SceneIntegration(*this)) > { > #if USE(GLIB_EVENT_LOOP) > m_layerFlushTimer.setPriority(RunLoopSourcePriority::LayerFlushTimer); >@@ -379,11 +380,21 @@ void LayerTreeHost::commitSceneState(const CoordinatedGraphicsState& state) > m_compositor->updateSceneState(state); > } > >+RefPtr<Nicosia::SceneIntegration> LayerTreeHost::sceneIntegration() >+{ >+ return m_sceneIntegration.copyRef(); >+} >+ > void LayerTreeHost::frameComplete() > { > m_compositor->frameComplete(); > } > >+void LayerTreeHost::requestUpdate() >+{ >+ m_compositor->updateScene(); >+} >+ > uint64_t LayerTreeHost::nativeSurfaceHandleForCompositing() > { > if (!m_surface) >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h >index 38f3b7fabd45f616d2c1595687db225e3f5d4db8..ac928dda2a0c85649bef266a78b5d45d63e412ba 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h >@@ -39,6 +39,10 @@ > #include <wtf/OptionSet.h> > #include <wtf/RunLoop.h> > >+#if USE(COORDINATED_GRAPHICS) >+#include <WebCore/NicosiaSceneIntegration.h> >+#endif >+ > namespace WebCore { > class IntRect; > class IntSize; >@@ -54,7 +58,7 @@ class WebPage; > > class LayerTreeHost > #if USE(COORDINATED_GRAPHICS) >- final : public CompositingCoordinator::Client, public AcceleratedSurface::Client >+ final : public CompositingCoordinator::Client, public AcceleratedSurface::Client, public Nicosia::SceneIntegration::Client > #endif > { > WTF_MAKE_FAST_ALLOCATED; >@@ -107,10 +111,14 @@ private: > void didFlushRootLayer(const WebCore::FloatRect& visibleContentRect) override; > void notifyFlushRequired() override { scheduleLayerFlush(); }; > void commitSceneState(const WebCore::CoordinatedGraphicsState&) override; >+ RefPtr<Nicosia::SceneIntegration> sceneIntegration() override; > > // AcceleratedSurface::Client > void frameComplete() override; > >+ // Nicosia::SceneIntegration::Client >+ void requestUpdate() override; >+ > uint64_t nativeSurfaceHandleForCompositing(); > void didDestroyGLContext(); > void willRenderFrame(); >@@ -197,6 +205,7 @@ private: > bool needsFreshFlush { false }; > } m_forceRepaintAsync; > RunLoop::Timer<LayerTreeHost> m_layerFlushTimer; >+ Ref<Nicosia::SceneIntegration> m_sceneIntegration; > #endif // USE(COORDINATED_GRAPHICS) > }; >
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 198475
:
371176
|
371726
|
372735
|
377119