WebKit Bugzilla
Attachment 338863 Details for
Bug 184961
: [GTK][WPE] Initial ASYNC_SCROLLING support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-184961-20180426093610.patch (text/plain), 52.61 KB, created by
Zan Dobersek
on 2018-04-26 00:36:11 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Zan Dobersek
Created:
2018-04-26 00:36:11 PDT
Size:
52.61 KB
patch
obsolete
>Subversion Revision: 231042 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b60aae27e92f030c34b1f0fd312ab72ac15172b1..b7324bc521d7013b039a5748a94a1b4c9c37b132 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,81 @@ >+2018-04-26 Zan Dobersek <zdobersek@igalia.com> >+ >+ [GTK][WPE] Initial ASYNC_SCROLLING support >+ https://bugs.webkit.org/show_bug.cgi?id=184961 >+ >+ Reviewed by Carlos Garcia Campos. >+ >+ Add CoordinatedGraphics-specific code that will be required for async >+ scrolling support. The ScrollingCoordinatorCoordinatedGraphics and >+ ScrollingTreeCoordinatedGraphics classes are mostly complete already, >+ but the new ScrollingTreeNode-inheriting classes will need further >+ work that will have to be done in parallel with other improvements >+ planned for the CoordinatedGraphics subsystem. >+ >+ While the build-time flag is enabled, the feature is still not enabled >+ at runtime due to being marked as unsupported by the DrawingArea >+ implementation in the WebKit layer. It would also not work yet if it >+ were enabled due to the before-mentioned pending changes. >+ >+ Various build fixes that address non-Cocoa usage of ASYNC_SCROLLING >+ code are included. >+ >+ * Sources.txt: Add AsyncScrollingCoordinator.cpp to build. >+ * SourcesCocoa.txt: >+ * SourcesGTK.txt: Add new files to build. >+ * SourcesWPE.txt: Ditto. >+ * page/scrolling/AsyncScrollingCoordinator.cpp: >+ Guard setStateScrollingNodeSnapOffsetsAsFloat() with CSS_SCROLL_SNAP. >+ * page/scrolling/ScrollingTree.h: >+ * page/scrolling/ThreadedScrollingTree.cpp: >+ * page/scrolling/ThreadedScrollingTree.h: >+ currentSnapPointIndicesDidChange() method is only invoked in >+ Cocoa-specific code, and its implementation calls Cocoa-specific method >+ on the AsyncScrollingCoordinator class. >+ * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp: >+ (WebCore::ScrollingCoordinator::create): >+ (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics): >+ (WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics): >+ (WebCore::ScrollingCoordinatorCoordinatedGraphics::pageDestroyed): >+ (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeStateIfNeeded): >+ (WebCore::ScrollingCoordinatorCoordinatedGraphics::handleWheelEvent): >+ (WebCore::ScrollingCoordinatorCoordinatedGraphics::scheduleTreeStateCommit): >+ (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeState): >+ * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added. >+ * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp: Added. >+ (WebCore::ScrollingTreeCoordinatedGraphics::create): >+ (WebCore::ScrollingTreeCoordinatedGraphics::ScrollingTreeCoordinatedGraphics): >+ (WebCore::ScrollingTreeCoordinatedGraphics::createScrollingTreeNode): >+ * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h: Added. >+ * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp: Added. >+ (WebCore::ScrollingTreeFixedNode::create): >+ (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode): >+ (WebCore::ScrollingTreeFixedNode::~ScrollingTreeFixedNode): >+ (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren): >+ (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): >+ * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h: Added. >+ * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp: Added. >+ (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create): >+ (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::ScrollingTreeFrameScrollingNodeCoordinatedGraphics): >+ (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::handleWheelEvent): >+ (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::scrollPosition const): >+ (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPosition): >+ (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPositionWithoutContentEdgeConstraints): >+ (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollLayerPosition): >+ (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::updateLayersAfterViewportChange): >+ * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h: Added. >+ * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp: Added. >+ (WebCore::ScrollingTreeStickyNode::create): >+ (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode): >+ (WebCore::ScrollingTreeStickyNode::~ScrollingTreeStickyNode): >+ (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren): >+ (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): >+ * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h: Added. >+ * platform/PlatformWheelEvent.h: Enable PlatformWheelEventPhase code >+ for WPE. Guard latching-specific methods under ASYNC_SCROLLING. >+ * platform/TextureMapper.cmake: Two build targets have been moved to >+ SourcesGTK.txt and SourcesWPE.txt. >+ > 2018-04-25 Michael Catanzaro <mcatanzaro@igalia.com> > > [WPE] Build and link against latest WPEBackend and WPEBackend-fdo >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 7d22fdb5216ed102a37b6f0223e44074af6d8b9e..16699930d76d89fd72453eafa641312d03089bdd 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,26 @@ >+2018-04-26 Zan Dobersek <zdobersek@igalia.com> >+ >+ [GTK][WPE] Initial ASYNC_SCROLLING support >+ https://bugs.webkit.org/show_bug.cgi?id=184961 >+ >+ Reviewed by Carlos Garcia Campos. >+ >+ Guard RemoteScrollingCoordinator and RemoteScrollingCoordinatorProxy >+ usage in WebChromeClient and WebPageProxy, respectively, with >+ PLATFORM(COCOA) in addition to the ASYNC_SCROLLING guards. >+ >+ Despite enabling the code at build-time, the feature (as intended) is >+ not yet used because of the DrawingArea rejection in the WebPage >+ constructor. >+ >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::initializeWebPage): >+ (WebKit::WebPageProxy::handleWheelEvent): >+ (WebKit::WebPageProxy::updateTouchEventTracking): >+ * UIProcess/WebPageProxy.h: >+ * WebProcess/WebCoreSupport/WebChromeClient.cpp: >+ (WebKit::WebChromeClient::createScrollingCoordinator const): >+ > 2018-04-25 Michael Catanzaro <mcatanzaro@igalia.com> > > [WPE] Build and link against latest WPEBackend and WPEBackend-fdo >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 038853e43f6bbd167f49aad3ff88dc7cfac66a03..4bac2c085edfff80476488b9297ba709685bc9aa 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -1436,6 +1436,7 @@ page/csp/ContentSecurityPolicySource.cpp > page/csp/ContentSecurityPolicySourceList.cpp > page/csp/ContentSecurityPolicySourceListDirective.cpp > >+page/scrolling/AsyncScrollingCoordinator.cpp > page/scrolling/AxisScrollSnapOffsets.cpp > page/scrolling/ScrollLatchingState.cpp > page/scrolling/ScrollingConstraints.cpp >diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt >index a03633028af8de435ebe9e2ba54a3927cc7138b2..26fb2f0ca452cea250834669047ec468617a6eb5 100644 >--- a/Source/WebCore/SourcesCocoa.txt >+++ b/Source/WebCore/SourcesCocoa.txt >@@ -140,7 +140,6 @@ page/mac/ServicesOverlayController.mm > page/mac/TextIndicatorWindow.mm > page/mac/WheelEventDeltaFilterMac.mm > >-page/scrolling/AsyncScrollingCoordinator.cpp > page/scrolling/ScrollingMomentumCalculator.cpp > > page/scrolling/cocoa/ScrollingStateNode.mm >diff --git a/Source/WebCore/SourcesGTK.txt b/Source/WebCore/SourcesGTK.txt >index ffca9a29a385adb5947b8c324e79f2c50c67b540..92acd0bcafd6e0abd65ef4f65eb94564199cf85a 100644 >--- a/Source/WebCore/SourcesGTK.txt >+++ b/Source/WebCore/SourcesGTK.txt >@@ -46,6 +46,13 @@ loader/soup/ResourceLoaderSoup.cpp > page/linux/ResourceUsageOverlayLinux.cpp > page/linux/ResourceUsageThreadLinux.cpp > >+page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp >+page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp >+page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp >+page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp >+page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp >+page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp >+ > page/scrolling/generic/ScrollingThreadGeneric.cpp > > platform/ScrollAnimationKinetic.cpp >diff --git a/Source/WebCore/SourcesWPE.txt b/Source/WebCore/SourcesWPE.txt >index e861dae5d36864aa9c69a141a2b24c1efd6fc3b0..fc0019b53ba585ef0923718d7d74b70991b6a516 100644 >--- a/Source/WebCore/SourcesWPE.txt >+++ b/Source/WebCore/SourcesWPE.txt >@@ -32,6 +32,10 @@ page/linux/ResourceUsageOverlayLinux.cpp > page/linux/ResourceUsageThreadLinux.cpp > > page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp >+page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp >+page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp >+page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp >+page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp > page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp > > page/scrolling/generic/ScrollingThreadGeneric.cpp >diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >index e2ecd5a2ff9a7bb18ee8656c0bb1e4a2e8ab8baf..0bf3197e17f060c095b6fea9e70363efdcced315 100644 >--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >@@ -64,6 +64,7 @@ void AsyncScrollingCoordinator::scrollingStateTreePropertiesChanged() > scheduleTreeStateCommit(); > } > >+#if ENABLE(CSS_SCROLL_SNAP) > static inline void setStateScrollingNodeSnapOffsetsAsFloat(ScrollingStateScrollingNode& node, ScrollEventAxis axis, const Vector<LayoutUnit>* snapOffsets, const Vector<ScrollOffsetRange<LayoutUnit>>* snapOffsetRanges, float deviceScaleFactor) > { > // FIXME: Incorporate current page scale factor in snapping to device pixel. Perhaps we should just convert to float here and let UI process do the pixel snapping? >@@ -88,6 +89,7 @@ static inline void setStateScrollingNodeSnapOffsetsAsFloat(ScrollingStateScrolli > node.setVerticalSnapOffsetRanges(snapOffsetRangesAsFloat); > } > } >+#endif > > void AsyncScrollingCoordinator::setEventTrackingRegionsDirty() > { >diff --git a/Source/WebCore/page/scrolling/ScrollingTree.h b/Source/WebCore/page/scrolling/ScrollingTree.h >index 194014ae5a3e97e93bce840c928555686a054b44..1d9deaadbefb61a33b283be03b607e1f985a68a8 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTree.h >+++ b/Source/WebCore/page/scrolling/ScrollingTree.h >@@ -91,8 +91,6 @@ public: > // and call scrollingTreeNodeDidScroll(). > WEBCORE_EXPORT virtual void scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool inUserInteraction); > >- WEBCORE_EXPORT virtual void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) = 0; >- > WEBCORE_EXPORT virtual void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons) { } > WEBCORE_EXPORT virtual void reportExposedUnfilledArea(MonotonicTime, unsigned /* unfilledArea */) { } > >@@ -114,6 +112,10 @@ public: > virtual void removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) { } > #endif > >+#if PLATFORM(COCOA) >+ WEBCORE_EXPORT virtual void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) = 0; >+#endif >+ > // Can be called from any thread. Will update what edges allow rubber-banding. > WEBCORE_EXPORT void setCanRubberBandState(bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom); > >diff --git a/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp b/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp >index f85e64de71cbd3d5b29f40a7e45967d74b27fa4f..5c7ba803b6f98c1ba7c1f5f4a1b5d65e6c0f5865 100644 >--- a/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp >+++ b/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp >@@ -31,10 +31,8 @@ > #include "AsyncScrollingCoordinator.h" > #include "PlatformWheelEvent.h" > #include "ScrollingThread.h" >-#include "ScrollingTreeFixedNode.h" > #include "ScrollingTreeNode.h" > #include "ScrollingTreeScrollingNode.h" >-#include "ScrollingTreeStickyNode.h" > #include <wtf/RunLoop.h> > > namespace WebCore { >@@ -119,6 +117,7 @@ void ThreadedScrollingTree::reportExposedUnfilledArea(MonotonicTime timestamp, u > }); > } > >+#if PLATFORM(COCOA) > void ThreadedScrollingTree::currentSnapPointIndicesDidChange(ScrollingNodeID nodeID, unsigned horizontal, unsigned vertical) > { > if (!m_scrollingCoordinator) >@@ -128,6 +127,7 @@ void ThreadedScrollingTree::currentSnapPointIndicesDidChange(ScrollingNodeID nod > scrollingCoordinator->setActiveScrollSnapIndices(nodeID, horizontal, vertical); > }); > } >+#endif > > #if PLATFORM(MAC) > void ThreadedScrollingTree::handleWheelEventPhase(PlatformWheelEventPhase phase) >diff --git a/Source/WebCore/page/scrolling/ThreadedScrollingTree.h b/Source/WebCore/page/scrolling/ThreadedScrollingTree.h >index 46f643c01a6da254a1e74d0542f328925b83d32d..db3c3d5cfb9e908b3f7d23dd168f920d1c7a3481 100644 >--- a/Source/WebCore/page/scrolling/ThreadedScrollingTree.h >+++ b/Source/WebCore/page/scrolling/ThreadedScrollingTree.h >@@ -58,7 +58,6 @@ protected: > explicit ThreadedScrollingTree(AsyncScrollingCoordinator&); > > void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) override; >- void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) override; > #if PLATFORM(MAC) > void handleWheelEventPhase(PlatformWheelEventPhase) override; > void setActiveScrollSnapIndices(ScrollingNodeID, unsigned horizontalIndex, unsigned verticalIndex) override; >@@ -66,6 +65,10 @@ protected: > void removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) override; > #endif > >+#if PLATFORM(COCOA) >+ void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) override; >+#endif >+ > void reportExposedUnfilledArea(MonotonicTime, unsigned unfilledArea) override; > void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons) override; > >diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp >index b1a47758b9249c7f6b96257a5d012780571ddd30..d23f3783326c032cc73a23a543b240f10435baef 100644 >--- a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp >+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp >@@ -1,39 +1,94 @@ > /* >- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). >+ * 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. >+ * 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 ``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 HOLDERS 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 >+ * 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 "ScrollingCoordinator.h" >+#include "ScrollingCoordinatorCoordinatedGraphics.h" > > #if USE(COORDINATED_GRAPHICS) > >+#include "ScrollingThread.h" >+#include "ScrollingTreeCoordinatedGraphics.h" >+ > namespace WebCore { > > Ref<ScrollingCoordinator> ScrollingCoordinator::create(Page* page) > { >- // FIXME: Return an object implementing AsyncScrollingCoordinator. >- return adoptRef(*new ScrollingCoordinator(page)); >+ return adoptRef(*new ScrollingCoordinatorCoordinatedGraphics(page)); >+} >+ >+ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics(Page* page) >+ : AsyncScrollingCoordinator(page) >+ , m_scrollingStateTreeCommitterTimer(RunLoop::main(), this, &ScrollingCoordinatorCoordinatedGraphics::commitTreeState) >+{ >+ setScrollingTree(ScrollingTreeCoordinatedGraphics::create(*this)); >+} >+ >+ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics() >+{ >+ ASSERT(!scrollingTree()); >+} >+ >+void ScrollingCoordinatorCoordinatedGraphics::pageDestroyed() >+{ >+ AsyncScrollingCoordinator::pageDestroyed(); >+ >+ m_scrollingStateTreeCommitterTimer.stop(); >+ >+ releaseScrollingTree(); >+} >+ >+void ScrollingCoordinatorCoordinatedGraphics::commitTreeStateIfNeeded() >+{ >+ commitTreeState(); >+ m_scrollingStateTreeCommitterTimer.stop(); >+} >+ >+bool ScrollingCoordinatorCoordinatedGraphics::handleWheelEvent(FrameView&, const PlatformWheelEvent&) >+{ >+ return false; >+} >+ >+void ScrollingCoordinatorCoordinatedGraphics::scheduleTreeStateCommit() >+{ >+ if (!m_scrollingStateTreeCommitterTimer.isActive()) >+ m_scrollingStateTreeCommitterTimer.startOneShot(0_s); >+} >+ >+void ScrollingCoordinatorCoordinatedGraphics::commitTreeState() >+{ >+ if (!scrollingStateTree()->hasChangedProperties()) >+ return; >+ >+ RefPtr<ThreadedScrollingTree> threadedScrollingTree = downcast<ThreadedScrollingTree>(scrollingTree()); >+ >+ auto treeState = scrollingStateTree()->commit(LayerRepresentation::PlatformLayerRepresentation); >+ ScrollingThread::dispatch([threadedScrollingTree, treeState = WTFMove(treeState)]() mutable { >+ threadedScrollingTree->commitTreeState(WTFMove(treeState)); >+ }); > } > > } // namespace WebCore >diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h >new file mode 100644 >index 0000000000000000000000000000000000000000..8257422ec9eda0657712f5c626e11ef3345b4633 >--- /dev/null >+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h >@@ -0,0 +1,59 @@ >+/* >+ * 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(COORDINATED_GRAPHICS) >+ >+#include "AsyncScrollingCoordinator.h" >+ >+#include <wtf/RunLoop.h> >+ >+namespace WebCore { >+ >+class ScrollingCoordinatorCoordinatedGraphics final : public AsyncScrollingCoordinator { >+public: >+ explicit ScrollingCoordinatorCoordinatedGraphics(Page*); >+ virtual ~ScrollingCoordinatorCoordinatedGraphics(); >+ >+ void pageDestroyed() override; >+ >+ void commitTreeStateIfNeeded() override; >+ >+ bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) override; >+ >+private: >+ void scheduleTreeStateCommit() override; >+ >+ void commitTreeState(); >+ >+ RunLoop::Timer<ScrollingCoordinatorCoordinatedGraphics> m_scrollingStateTreeCommitterTimer; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..6bfca4dfd512f8c2c083999d6e71b9cdf4a3a5d6 >--- /dev/null >+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp >@@ -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. >+ */ >+ >+#include "config.h" >+#include "ScrollingTreeCoordinatedGraphics.h" >+ >+#if ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >+ >+#include "ScrollingTreeFixedNode.h" >+#include "ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h" >+#include "ScrollingTreeStickyNode.h" >+ >+namespace WebCore { >+ >+Ref<ScrollingTreeCoordinatedGraphics> ScrollingTreeCoordinatedGraphics::create(AsyncScrollingCoordinator& scrollingCoordinator) >+{ >+ return adoptRef(*new ScrollingTreeCoordinatedGraphics(scrollingCoordinator)); >+} >+ >+ScrollingTreeCoordinatedGraphics::ScrollingTreeCoordinatedGraphics(AsyncScrollingCoordinator& scrollingCoordinator) >+ : ThreadedScrollingTree(scrollingCoordinator) >+{ >+} >+ >+Ref<ScrollingTreeNode> ScrollingTreeCoordinatedGraphics::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID) >+{ >+ switch (nodeType) { >+ case MainFrameScrollingNode: >+ case SubframeScrollingNode: >+ return ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create(*this, nodeType, nodeID); >+ case OverflowScrollingNode: >+ // Should not be reached -- caught by ASSERT_NOT_REACHED() below. >+ break; >+ case FixedNode: >+ return ScrollingTreeFixedNode::create(*this, nodeID); >+ case StickyNode: >+ return ScrollingTreeStickyNode::create(*this, nodeID); >+ } >+ >+ RELEASE_ASSERT_NOT_REACHED(); >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h >new file mode 100644 >index 0000000000000000000000000000000000000000..45bb645eb3b6b6265658370051b28217cb49e780 >--- /dev/null >+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h >@@ -0,0 +1,48 @@ >+/* >+ * 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(COORDINATED_GRAPHICS) >+ >+#include "ThreadedScrollingTree.h" >+ >+namespace WebCore { >+ >+class ScrollingTreeCoordinatedGraphics final : public ThreadedScrollingTree { >+public: >+ static Ref<ScrollingTreeCoordinatedGraphics> create(AsyncScrollingCoordinator&); >+ >+private: >+ explicit ScrollingTreeCoordinatedGraphics(AsyncScrollingCoordinator&); >+ >+ Ref<ScrollingTreeNode> createScrollingTreeNode(ScrollingNodeType, ScrollingNodeID) override; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..24081703eb1d4827e2d6e1bc69fea2abc242c2e3 >--- /dev/null >+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp >@@ -0,0 +1,61 @@ >+/* >+ * 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 "ScrollingTreeFixedNode.h" >+ >+#if ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >+ >+namespace WebCore { >+ >+Ref<ScrollingTreeFixedNode> ScrollingTreeFixedNode::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID) >+{ >+ return adoptRef(*new ScrollingTreeFixedNode(scrollingTree, nodeID)); >+} >+ >+ScrollingTreeFixedNode::ScrollingTreeFixedNode(ScrollingTree& scrollingTree, ScrollingNodeID nodeID) >+ : ScrollingTreeNode(scrollingTree, FixedNode, nodeID) >+{ >+ scrollingTree.fixedOrStickyNodeAdded(); >+} >+ >+ScrollingTreeFixedNode::~ScrollingTreeFixedNode() >+{ >+ scrollingTree().fixedOrStickyNodeRemoved(); >+} >+ >+void ScrollingTreeFixedNode::commitStateBeforeChildren(const ScrollingStateNode&) >+{ >+} >+ >+void ScrollingTreeFixedNode::updateLayersAfterAncestorChange(const ScrollingTreeNode&, const FloatRect&, const FloatSize&) >+{ >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h >new file mode 100644 >index 0000000000000000000000000000000000000000..d0aa8792422230cece2e63ff4f16bf779fe88a87 >--- /dev/null >+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h >@@ -0,0 +1,50 @@ >+/* >+ * 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(COORDINATED_GRAPHICS) >+ >+#include "ScrollingTreeNode.h" >+ >+namespace WebCore { >+ >+class ScrollingTreeFixedNode final : public ScrollingTreeNode { >+public: >+ static Ref<ScrollingTreeFixedNode> create(ScrollingTree&, ScrollingNodeID); >+ virtual ~ScrollingTreeFixedNode(); >+ >+private: >+ ScrollingTreeFixedNode(ScrollingTree&, ScrollingNodeID); >+ >+ void commitStateBeforeChildren(const ScrollingStateNode&) override; >+ void updateLayersAfterAncestorChange(const ScrollingTreeNode&, const FloatRect&, const FloatSize&) override; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..ecc6f31730616030da865ffc9b8e0b93b8666362 >--- /dev/null >+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp >@@ -0,0 +1,74 @@ >+/* >+ * 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 "ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h" >+ >+#if ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >+ >+namespace WebCore { >+ >+Ref<ScrollingTreeFrameScrollingNode> ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID) >+{ >+ return adoptRef(*new ScrollingTreeFrameScrollingNodeCoordinatedGraphics(scrollingTree, nodeType, nodeID)); >+} >+ >+ScrollingTreeFrameScrollingNodeCoordinatedGraphics::ScrollingTreeFrameScrollingNodeCoordinatedGraphics(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID) >+ : ScrollingTreeFrameScrollingNode(scrollingTree, nodeType, nodeID) >+{ >+} >+ >+ScrollingTreeFrameScrollingNodeCoordinatedGraphics::~ScrollingTreeFrameScrollingNodeCoordinatedGraphics() = default; >+ >+void ScrollingTreeFrameScrollingNodeCoordinatedGraphics::handleWheelEvent(const PlatformWheelEvent&) >+{ >+} >+ >+FloatPoint ScrollingTreeFrameScrollingNodeCoordinatedGraphics::scrollPosition() const >+{ >+ return { }; >+} >+ >+void ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPosition(const FloatPoint&) >+{ >+} >+ >+void ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) >+{ >+} >+ >+void ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollLayerPosition(const FloatPoint&, const FloatRect&) >+{ >+} >+ >+void ScrollingTreeFrameScrollingNodeCoordinatedGraphics::updateLayersAfterViewportChange(const FloatRect&, double) >+{ >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h >new file mode 100644 >index 0000000000000000000000000000000000000000..65086cc92bdfde8d4a506671277875e3be32593f >--- /dev/null >+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h >@@ -0,0 +1,56 @@ >+/* >+ * 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(COORDINATED_GRAPHICS) >+ >+#include "ScrollingTreeFrameScrollingNode.h" >+ >+namespace WebCore { >+ >+class ScrollingTreeFrameScrollingNodeCoordinatedGraphics final : public ScrollingTreeFrameScrollingNode { >+public: >+ static Ref<ScrollingTreeFrameScrollingNode> create(ScrollingTree&, ScrollingNodeType, ScrollingNodeID); >+ virtual ~ScrollingTreeFrameScrollingNodeCoordinatedGraphics(); >+ >+private: >+ ScrollingTreeFrameScrollingNodeCoordinatedGraphics(ScrollingTree&, ScrollingNodeType, ScrollingNodeID); >+ >+ void handleWheelEvent(const PlatformWheelEvent&) override; >+ >+ FloatPoint scrollPosition() const override; >+ void setScrollPosition(const FloatPoint&) override; >+ void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override; >+ void setScrollLayerPosition(const FloatPoint&, const FloatRect&) override; >+ >+ void updateLayersAfterViewportChange(const FloatRect&, double) override; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..25a7689142340fb5fa28903e6771c5f0c757eb0d >--- /dev/null >+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp >@@ -0,0 +1,61 @@ >+/* >+ * 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 "ScrollingTreeStickyNode.h" >+ >+#if ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >+ >+namespace WebCore { >+ >+Ref<ScrollingTreeStickyNode> ScrollingTreeStickyNode::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID) >+{ >+ return adoptRef(*new ScrollingTreeStickyNode(scrollingTree, nodeID)); >+} >+ >+ScrollingTreeStickyNode::ScrollingTreeStickyNode(ScrollingTree& scrollingTree, ScrollingNodeID nodeID) >+ : ScrollingTreeNode(scrollingTree, StickyNode, nodeID) >+{ >+ scrollingTree.fixedOrStickyNodeAdded(); >+} >+ >+ScrollingTreeStickyNode::~ScrollingTreeStickyNode() >+{ >+ scrollingTree().fixedOrStickyNodeRemoved(); >+} >+ >+void ScrollingTreeStickyNode::commitStateBeforeChildren(const ScrollingStateNode&) >+{ >+} >+ >+void ScrollingTreeStickyNode::updateLayersAfterAncestorChange(const ScrollingTreeNode&, const FloatRect&, const FloatSize&) >+{ >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h >new file mode 100644 >index 0000000000000000000000000000000000000000..f3133a708c7a6c3a545eff879a7a0df15c7b53e8 >--- /dev/null >+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h >@@ -0,0 +1,50 @@ >+/* >+ * 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(COORDINATED_GRAPHICS) >+ >+#include "ScrollingTreeNode.h" >+ >+namespace WebCore { >+ >+class ScrollingTreeStickyNode final : public ScrollingTreeNode { >+public: >+ static Ref<ScrollingTreeStickyNode> create(ScrollingTree&, ScrollingNodeID); >+ virtual ~ScrollingTreeStickyNode(); >+ >+private: >+ ScrollingTreeStickyNode(ScrollingTree&, ScrollingNodeID); >+ >+ void commitStateBeforeChildren(const ScrollingStateNode&) override; >+ void updateLayersAfterAncestorChange(const ScrollingTreeNode&, const FloatRect&, const FloatSize&) override; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebCore/platform/PlatformWheelEvent.h b/Source/WebCore/platform/PlatformWheelEvent.h >index c1b6a2a8f1a1f7ed1c6efb30eef208ea0999cc54..e1d2d3b3fb454cd2f44897ea4ecd322c9f672c62 100644 >--- a/Source/WebCore/platform/PlatformWheelEvent.h >+++ b/Source/WebCore/platform/PlatformWheelEvent.h >@@ -48,7 +48,7 @@ enum PlatformWheelEventGranularity : uint8_t { > ScrollByPixelWheelEvent, > }; > >-#if PLATFORM(COCOA) || PLATFORM(GTK) >+#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) > > enum PlatformWheelEventPhase : uint8_t { > PlatformWheelEventPhaseNone = 0, >@@ -135,6 +135,9 @@ public: > unsigned scrollCount() const { return m_scrollCount; } > float unacceleratedScrollingDeltaX() const { return m_unacceleratedScrollingDeltaX; } > float unacceleratedScrollingDeltaY() const { return m_unacceleratedScrollingDeltaY; } >+#endif >+ >+#if ENABLE(ASYNC_SCROLLING) > bool useLatchedEventElement() const; > bool shouldConsiderLatching() const; > bool shouldResetLatching() const; >@@ -143,7 +146,7 @@ public: > bool useLatchedEventElement() const { return false; } > #endif > >-#if PLATFORM(COCOA) || PLATFORM(GTK) >+#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) > PlatformWheelEventPhase phase() const { return m_phase; } > PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; } > bool isEndOfNonMomentumScroll() const; >@@ -168,7 +171,7 @@ protected: > // Scrolling velocity in pixels per second. > FloatSize m_scrollingVelocity; > >-#if PLATFORM(COCOA) || PLATFORM(GTK) >+#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) > PlatformWheelEventPhase m_phase { PlatformWheelEventPhaseNone }; > PlatformWheelEventPhase m_momentumPhase { PlatformWheelEventPhaseNone }; > #endif >@@ -180,7 +183,7 @@ protected: > #endif > }; > >-#if PLATFORM(COCOA) >+#if ENABLE(ASYNC_SCROLLING) > > inline bool PlatformWheelEvent::useLatchedEventElement() const > { >diff --git a/Source/WebCore/platform/TextureMapper.cmake b/Source/WebCore/platform/TextureMapper.cmake >index ea926cee21b386a469be347a829a985e1544ebf2..6eab6a0a1895adaf78751d190c1688d47bfc77ff 100644 >--- a/Source/WebCore/platform/TextureMapper.cmake >+++ b/Source/WebCore/platform/TextureMapper.cmake >@@ -30,9 +30,6 @@ if (USE_COORDINATED_GRAPHICS) > "${WEBCORE_DIR}/platform/graphics/texmap/coordinated" > ) > list(APPEND WebCore_SOURCES >- page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp >- page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp >- > platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp > platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp > >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index bbc52aa8ecf053bfa2bebb606ec13576c6b97432..d72ce2e610eff6228a032e723f004b4b97217b03 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -156,7 +156,7 @@ > #include "APIApplicationManifest.h" > #endif > >-#if ENABLE(ASYNC_SCROLLING) >+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA) > #include "RemoteScrollingCoordinatorProxy.h" > #endif > >@@ -804,7 +804,7 @@ void WebPageProxy::initializeWebPage() > m_drawingArea = m_pageClient.createDrawingAreaProxy(); > ASSERT(m_drawingArea); > >-#if ENABLE(ASYNC_SCROLLING) >+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA) > if (m_drawingArea->type() == DrawingAreaTypeRemoteLayerTree) { > m_scrollingCoordinatorProxy = std::make_unique<RemoteScrollingCoordinatorProxy>(*this); > #if PLATFORM(IOS) >@@ -2016,7 +2016,7 @@ static WebWheelEvent coalescedWheelEvent(Deque<NativeWebWheelEvent>& queue, Vect > > void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event) > { >-#if ENABLE(ASYNC_SCROLLING) >+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA) > if (m_scrollingCoordinatorProxy && m_scrollingCoordinatorProxy->handleWheelEvent(platform(event))) > return; > #endif >@@ -2190,7 +2190,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) > > void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent) > { >-#if ENABLE(ASYNC_SCROLLING) >+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA) > const EventNames& names = eventNames(); > for (auto& touchPoint : touchStartEvent.touchPoints()) { > IntPoint location = touchPoint.location(); >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index b53445f24d5b3f56fe7e8f2e1e2bdf309ff1bf21..0dd9f0cd24d3896c408fa26ed92001a53477272f 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -347,7 +347,7 @@ public: > NSArray *dataDetectionResults() { return m_dataDetectionResults.get(); } > #endif > >-#if ENABLE(ASYNC_SCROLLING) >+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA) > RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); } > #endif > >@@ -1780,7 +1780,7 @@ private: > bool m_isLoadingAlternateHTMLStringForFailingProvisionalLoad { false }; > > std::unique_ptr<DrawingAreaProxy> m_drawingArea; >-#if ENABLE(ASYNC_SCROLLING) >+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA) > std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy; > #endif > >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >index 621ea39099dd48f3875f32618d79d8fc7196148f..0a3ea5f8dd9879109eae6165a726437586d5ffce 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >@@ -928,9 +928,13 @@ bool WebChromeClient::layerTreeStateIsFrozen() const > RefPtr<ScrollingCoordinator> WebChromeClient::createScrollingCoordinator(Page& page) const > { > ASSERT_UNUSED(page, m_page.corePage() == &page); >+#if PLATFORM(COCOA) > if (m_page.drawingArea()->type() != DrawingAreaTypeRemoteLayerTree) > return nullptr; > return RemoteScrollingCoordinator::create(&m_page); >+#else >+ return nullptr; >+#endif > } > > #endif >diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake >index 8f15fe4b7e64ff3cbc489e724e9580065eb90b60..9abecc9a8d2a5d5af3278e53cf7693f3a0eb4bfa 100644 >--- a/Source/cmake/OptionsGTK.cmake >+++ b/Source/cmake/OptionsGTK.cmake >@@ -121,6 +121,7 @@ endif () > # without approval from a GTK+ reviewer. There must be strong reason to support > # changing the value of the option. > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS PUBLIC OFF) >+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ASYNC_SCROLLING PRIVATE ON) > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DRAG_SUPPORT PUBLIC ON) > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PUBLIC ON) > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ICONDATABASE PUBLIC ON) >diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake >index c5dc4df07861b3a2e772aa604ab0ebe8fcaa3b2c..4dc17a9a32dbbfd888f0f1a410220ef2815de7a6 100644 >--- a/Source/cmake/OptionsWPE.cmake >+++ b/Source/cmake/OptionsWPE.cmake >@@ -31,6 +31,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SYSTEM_MALLOC PUBLIC OFF) > # we need a value different from the default defined in WebKitFeatures.cmake. > # Changing these options is completely unsupported. > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCESSIBILITY PRIVATE ON) >+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ASYNC_SCROLLING PRIVATE ON) > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FULLSCREEN_API PRIVATE OFF) > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PRIVATE OFF) > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MHTML PRIVATE ON) >diff --git a/ChangeLog b/ChangeLog >index 4b6b5a8b7225d8e3236fd0d3cc393e2ac234a772..c4bb8f5200f16d651e856a6e4d90052923332408 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,13 @@ >+2018-04-26 Zan Dobersek <zdobersek@igalia.com> >+ >+ [GTK][WPE] Initial ASYNC_SCROLLING support >+ https://bugs.webkit.org/show_bug.cgi?id=184961 >+ >+ Reviewed by Carlos Garcia Campos. >+ >+ * Source/cmake/OptionsGTK.cmake: Enable ASYNC_SCROLLING as a private option. >+ * Source/cmake/OptionsWPE.cmake: Ditto. >+ > 2018-04-25 Michael Catanzaro <mcatanzaro@igalia.com> > > [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
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 184961
:
338715
|
338717
|
338726
| 338863