Let the DrawingArea decide whether scrolling is delegated
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Dec 2019 17:42:08 +0000 (17:42 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Dec 2019 17:42:08 +0000 (17:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=205258

Reviewed by Anders Carlsson.

.:

Let Xcode have its way with the workspace file, after the libANGLE rename.

* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme:

Source/WebKit:

Delegated scrolling was hardcoded on for iOS WK2 (as it is for iOS WK1) and off for macOS,
but if macOS is using RemoteLayerTreeDrawingArea that should also use delegated scrolling.

Also make some DrawingArea functions const, and put m_frame->coreFrame()->view() into
a local RefPtr in WebFrameLoaderClient::transitionToCommittedForNewPage().

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::supportsAsyncScrolling const):
(WebKit::DrawingArea::usesDelegatedScrolling const):
(WebKit::DrawingArea::shouldUseTiledBackingForFrameView const):
(WebKit::DrawingArea::supportsAsyncScrolling): Deleted.
(WebKit::DrawingArea::shouldUseTiledBackingForFrameView): Deleted.
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView const):
(WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Deleted.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView const):
(WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253559 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h
Source/WebKit/WebProcess/WebPage/DrawingArea.h
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm
Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme

index 4b7616f..3594b2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2019-12-16  Simon Fraser  <simon.fraser@apple.com>
+
+        Let the DrawingArea decide whether scrolling is delegated
+        https://bugs.webkit.org/show_bug.cgi?id=205258
+
+        Reviewed by Anders Carlsson.
+        
+        Let Xcode have its way with the workspace file, after the libANGLE rename.
+
+        * WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme:
+
 2019-12-12  Don Olmstead  <don.olmstead@sony.com>
 
         [CMake] Add LibPSL::LibPSL target
index 930ca2c..a647d66 100644 (file)
@@ -1,3 +1,33 @@
+2019-12-16  Simon Fraser  <simon.fraser@apple.com>
+
+        Let the DrawingArea decide whether scrolling is delegated
+        https://bugs.webkit.org/show_bug.cgi?id=205258
+
+        Reviewed by Anders Carlsson.
+        
+        Delegated scrolling was hardcoded on for iOS WK2 (as it is for iOS WK1) and off for macOS,
+        but if macOS is using RemoteLayerTreeDrawingArea that should also use delegated scrolling.
+        
+        Also make some DrawingArea functions const, and put m_frame->coreFrame()->view() into
+        a local RefPtr in WebFrameLoaderClient::transitionToCommittedForNewPage().
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit::DrawingArea::supportsAsyncScrolling const):
+        (WebKit::DrawingArea::usesDelegatedScrolling const):
+        (WebKit::DrawingArea::shouldUseTiledBackingForFrameView const):
+        (WebKit::DrawingArea::supportsAsyncScrolling): Deleted.
+        (WebKit::DrawingArea::shouldUseTiledBackingForFrameView): Deleted.
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView const):
+        (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Deleted.
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView const):
+        (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Deleted.
+
 2019-12-16  Eric Carlson  <eric.carlson@apple.com>
 
         Log when unimplemented remote MediaPlayer methods are called
index d6dd756..03a32d3 100644 (file)
@@ -1501,33 +1501,33 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
         webPage->fixedLayoutSize(), fixedVisibleContentRect, shouldUseFixedLayout,
         horizontalScrollbarMode, horizontalLock, verticalScrollbarMode, verticalLock);
 
+    RefPtr<FrameView> view = m_frame->coreFrame()->view();
     if (int width = webPage->minimumSizeForAutoLayout().width()) {
         int height = std::max(webPage->minimumSizeForAutoLayout().height(), 1);
-        m_frame->coreFrame()->view()->enableAutoSizeMode(true, { width, height });
+        view->enableAutoSizeMode(true, { width, height });
 
         if (webPage->autoSizingShouldExpandToViewHeight())
-            m_frame->coreFrame()->view()->setAutoSizeFixedMinimumHeight(webPage->size().height());
+            view->setAutoSizeFixedMinimumHeight(webPage->size().height());
     }
 
     if (auto viewportSizeForViewportUnits = webPage->viewportSizeForCSSViewportUnits())
-        m_frame->coreFrame()->view()->setViewportSizeForCSSViewportUnits(*viewportSizeForViewportUnits);
-    m_frame->coreFrame()->view()->setProhibitsScrolling(shouldDisableScrolling);
-    m_frame->coreFrame()->view()->setVisualUpdatesAllowedByClient(!webPage->shouldExtendIncrementalRenderingSuppression());
+        view->setViewportSizeForCSSViewportUnits(*viewportSizeForViewportUnits);
+    view->setProhibitsScrolling(shouldDisableScrolling);
+    view->setVisualUpdatesAllowedByClient(!webPage->shouldExtendIncrementalRenderingSuppression());
 #if PLATFORM(COCOA)
-    m_frame->coreFrame()->view()->setViewExposedRect(webPage->drawingArea()->viewExposedRect());
-#endif
-#if PLATFORM(IOS_FAMILY)
+    auto* drawingArea = webPage->drawingArea();
+    view->setViewExposedRect(drawingArea->viewExposedRect());
     if (isMainFrame)
-        m_frame->coreFrame()->view()->setDelegatesScrolling(true);
+        view->setDelegatesScrolling(drawingArea->usesDelegatedScrolling());
 #endif
 
     if (webPage->scrollPinningBehavior() != DoNotPin)
-        m_frame->coreFrame()->view()->setScrollPinningBehavior(webPage->scrollPinningBehavior());
+        view->setScrollPinningBehavior(webPage->scrollPinningBehavior());
 
 #if USE(COORDINATED_GRAPHICS)
     if (shouldUseFixedLayout) {
-        m_frame->coreFrame()->view()->setDelegatesScrolling(shouldUseFixedLayout);
-        m_frame->coreFrame()->view()->setPaintsEntireContents(shouldUseFixedLayout);
+        view->setDelegatesScrolling(shouldUseFixedLayout);
+        view->setPaintsEntireContents(shouldUseFixedLayout);
         return;
     }
 #endif
index 39a26b0..a36d2c6 100644 (file)
@@ -291,7 +291,7 @@ void DrawingAreaCoordinatedGraphics::didChangeViewportAttributes(ViewportAttribu
 }
 #endif
 
-bool DrawingAreaCoordinatedGraphics::supportsAsyncScrolling()
+bool DrawingAreaCoordinatedGraphics::supportsAsyncScrolling() const
 {
     return m_supportsAsyncScrolling;
 }
index fff74d9..25a045d 100644 (file)
@@ -65,7 +65,7 @@ private:
     void didChangeViewportAttributes(WebCore::ViewportAttributes&&) override;
 #endif
 
-    bool supportsAsyncScrolling() override;
+    bool supportsAsyncScrolling() const override;
 
     WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
     void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
index 9e06303..59d78ae 100644 (file)
@@ -105,9 +105,10 @@ public:
 #endif
     virtual void mainFrameScrollabilityChanged(bool) { }
 
-    virtual bool supportsAsyncScrolling() { return false; }
+    virtual bool supportsAsyncScrolling() const { return false; }
+    virtual bool usesDelegatedScrolling() const { return false; }
 
-    virtual bool shouldUseTiledBackingForFrameView(const WebCore::FrameView&) { return false; }
+    virtual bool shouldUseTiledBackingForFrameView(const WebCore::FrameView&) const { return false; }
 
     virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() { return nullptr; }
     virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) = 0;
index 1d383d9..8b690c1 100644 (file)
@@ -74,11 +74,12 @@ private:
     RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override;
     void willDestroyDisplayRefreshMonitor(WebCore::DisplayRefreshMonitor*);
 
-    bool shouldUseTiledBackingForFrameView(const WebCore::FrameView&) override;
+    bool shouldUseTiledBackingForFrameView(const WebCore::FrameView&) const override;
 
     void updatePreferences(const WebPreferencesStore&) override;
 
-    bool supportsAsyncScrolling() override { return true; }
+    bool supportsAsyncScrolling() const override { return true; }
+    bool usesDelegatedScrolling() const override { return true; }
 
     void setLayerTreeStateIsFrozen(bool) override;
     bool layerTreeStateIsFrozen() const override { return m_isFlushingSuspended; }
index e8da19a..c87f00c 100644 (file)
@@ -161,7 +161,7 @@ void RemoteLayerTreeDrawingArea::updateGeometry(const IntSize& viewSize, bool fl
     send(Messages::DrawingAreaProxy::DidUpdateGeometry());
 }
 
-bool RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView(const FrameView& frameView)
+bool RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView(const FrameView& frameView) const
 {
     return frameView.frame().isMainFrame() || m_webPage.corePage()->settings().asyncFrameScrollingEnabled();
 }
index 5a1d7b9..d85dc41 100644 (file)
@@ -75,11 +75,11 @@ private:
     void setViewExposedRect(Optional<WebCore::FloatRect>) override;
     Optional<WebCore::FloatRect> viewExposedRect() const override { return m_scrolledViewExposedRect; }
 
-    bool supportsAsyncScrolling() override { return true; }
+    bool supportsAsyncScrolling() const override { return true; }
 
     void dispatchAfterEnsuringUpdatedScrollPosition(WTF::Function<void ()>&&) override;
 
-    bool shouldUseTiledBackingForFrameView(const WebCore::FrameView&) override;
+    bool shouldUseTiledBackingForFrameView(const WebCore::FrameView&) const override;
 
     void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag> changed, ActivityStateChangeID, const Vector<CallbackID>&) override;
     void didUpdateActivityStateTimerFired();
index 4cb3df9..9972fe1 100644 (file)
@@ -727,7 +727,7 @@ void TiledCoreAnimationDrawingArea::updateDebugInfoLayer(bool showLayer)
     }
 }
 
-bool TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView(const FrameView& frameView)
+bool TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView(const FrameView& frameView) const
 {
     return frameView.frame().isMainFrame() || m_webPage.corePage()->settings().asyncFrameScrollingEnabled();
 }
index 10a1b3c..e1c974c 100644 (file)
@@ -57,7 +57,7 @@
             <BuildableReference
                BuildableIdentifier = "primary"
                BlueprintIdentifier = "FB39D0D01200F0E300088E69"
-               BuildableName = "libANGLE.dylib"
+               BuildableName = "libANGLE-shared.dylib"
                BlueprintName = "ANGLE"
                ReferencedContainer = "container:Source/ThirdParty/ANGLE/ANGLE.xcodeproj">
             </BuildableReference>