Title: [257357] trunk/Source
Revision
257357
Author
an...@apple.com
Date
2020-02-25 08:36:00 -0800 (Tue, 25 Feb 2020)

Log Message

Remove throttling code from RenderLayerCompositor
https://bugs.webkit.org/show_bug.cgi?id=208135

Reviewed by Zalan Bujtas.

Source/WebCore:

It is only used on WK1, adds lots of complexity and is not very effective or correct.

Also do some "layer flush" -> "rendering update" renaming.

* page/FrameView.cpp:
(WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction):
(WebCore::FrameView::updateLayerFlushThrottling):
(WebCore::FrameView::setViewExposedRect):
(WebCore::FrameView::scheduleLayerFlushAllowingThrottling): Deleted.
* page/FrameView.h:
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::notifyRenderingUpdateRequired):
(WebCore::PageOverlayController::notifyFlushRequired): Deleted.
* page/PageOverlayController.h:
* page/mac/ServicesOverlayController.h:
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::notifyRenderingUpdateRequired):
(WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): Deleted.
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::canThrottleLayerFlush const): Deleted.
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::notifyRenderingUpdateRequired):
(WebCore::GraphicsLayerClient::notifyFlushRequired): Deleted.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/ios/LegacyTileCache.h:
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::scheduleRenderingUpdateForPendingRepaint):
(WebCore::LegacyTileCache::setNeedsDisplayInRect):
(WebCore::LegacyTileCache::updateTilingMode):
(WebCore::LegacyTileCache::scheduleLayerFlushForPendingRepaint): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::notifyRenderingUpdateRequired):
(WebCore::RenderLayerBacking::notifyFlushRequired): Deleted.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor):
(WebCore::RenderLayerCompositor::notifyRenderingUpdateRequired):
(WebCore::RenderLayerCompositor::scheduleRenderingUpdate):
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::didChangeVisibleRect):
(WebCore::RenderLayerCompositor::flushLayersSoon):
(WebCore::RenderLayerCompositor::frameViewDidScroll):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::notifyFlushRequired): Deleted.
(WebCore::RenderLayerCompositor::scheduleLayerFlush): Deleted.
(WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled): Deleted.
(WebCore::RenderLayerCompositor::disableLayerFlushThrottlingTemporarilyForInteraction): Deleted.
(WebCore::RenderLayerCompositor::isThrottlingLayerFlushes const): Deleted.
(WebCore::RenderLayerCompositor::startLayerFlushTimerIfNeeded): Deleted.
(WebCore::RenderLayerCompositor::startInitialLayerFlushTimerIfNeeded): Deleted.
(WebCore::RenderLayerCompositor::layerFlushTimerFired): Deleted.
* rendering/RenderLayerCompositor.h:

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _scheduleRenderingUpdateForPendingTileCacheRepaint]):
(-[WebView _scheduleLayerFlushForPendingTileCacheRepaint]): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (257356 => 257357)


--- trunk/Source/WebCore/ChangeLog	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/ChangeLog	2020-02-25 16:36:00 UTC (rev 257357)
@@ -1,3 +1,66 @@
+2020-02-25  Antti Koivisto  <an...@apple.com>
+
+        Remove throttling code from RenderLayerCompositor
+        https://bugs.webkit.org/show_bug.cgi?id=208135
+
+        Reviewed by Zalan Bujtas.
+
+        It is only used on WK1, adds lots of complexity and is not very effective or correct.
+
+        Also do some "layer flush" -> "rendering update" renaming.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction):
+        (WebCore::FrameView::updateLayerFlushThrottling):
+        (WebCore::FrameView::setViewExposedRect):
+        (WebCore::FrameView::scheduleLayerFlushAllowingThrottling): Deleted.
+        * page/FrameView.h:
+        * page/PageOverlayController.cpp:
+        (WebCore::PageOverlayController::notifyRenderingUpdateRequired):
+        (WebCore::PageOverlayController::notifyFlushRequired): Deleted.
+        * page/PageOverlayController.h:
+        * page/mac/ServicesOverlayController.h:
+        * page/mac/ServicesOverlayController.mm:
+        (WebCore::ServicesOverlayController::Highlight::notifyRenderingUpdateRequired):
+        (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): Deleted.
+        * platform/graphics/GraphicsLayer.h:
+        (WebCore::GraphicsLayer::canThrottleLayerFlush const): Deleted.
+        * platform/graphics/GraphicsLayerClient.h:
+        (WebCore::GraphicsLayerClient::notifyRenderingUpdateRequired):
+        (WebCore::GraphicsLayerClient::notifyFlushRequired): Deleted.
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        * platform/ios/LegacyTileCache.h:
+        * platform/ios/LegacyTileCache.mm:
+        (WebCore::LegacyTileCache::scheduleRenderingUpdateForPendingRepaint):
+        (WebCore::LegacyTileCache::setNeedsDisplayInRect):
+        (WebCore::LegacyTileCache::updateTilingMode):
+        (WebCore::LegacyTileCache::scheduleLayerFlushForPendingRepaint): Deleted.
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::notifyRenderingUpdateRequired):
+        (WebCore::RenderLayerBacking::notifyFlushRequired): Deleted.
+        * rendering/RenderLayerBacking.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::RenderLayerCompositor):
+        (WebCore::RenderLayerCompositor::notifyRenderingUpdateRequired):
+        (WebCore::RenderLayerCompositor::scheduleRenderingUpdate):
+        (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
+        (WebCore::RenderLayerCompositor::didChangeVisibleRect):
+        (WebCore::RenderLayerCompositor::flushLayersSoon):
+        (WebCore::RenderLayerCompositor::frameViewDidScroll):
+        (WebCore::RenderLayerCompositor::ensureRootLayer):
+        (WebCore::RenderLayerCompositor::attachRootLayer):
+        (WebCore::RenderLayerCompositor::notifyFlushRequired): Deleted.
+        (WebCore::RenderLayerCompositor::scheduleLayerFlush): Deleted.
+        (WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled): Deleted.
+        (WebCore::RenderLayerCompositor::disableLayerFlushThrottlingTemporarilyForInteraction): Deleted.
+        (WebCore::RenderLayerCompositor::isThrottlingLayerFlushes const): Deleted.
+        (WebCore::RenderLayerCompositor::startLayerFlushTimerIfNeeded): Deleted.
+        (WebCore::RenderLayerCompositor::startInitialLayerFlushTimerIfNeeded): Deleted.
+        (WebCore::RenderLayerCompositor::layerFlushTimerFired): Deleted.
+        * rendering/RenderLayerCompositor.h:
+
 2020-02-25  Andres Gonzalez  <andresg...@apple.com>
 
         IsolatedObject support for ProgressIndicator and Meter.

Modified: trunk/Source/WebCore/page/FrameView.cpp (257356 => 257357)


--- trunk/Source/WebCore/page/FrameView.cpp	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/page/FrameView.cpp	2020-02-25 16:36:00 UTC (rev 257357)
@@ -1018,12 +1018,12 @@
     return widgetLayer->backing()->parentForSublayers();
 }
 
-void FrameView::scheduleLayerFlushAllowingThrottling()
+void FrameView::scheduleRenderingUpdate()
 {
     RenderView* view = this->renderView();
     if (!view)
         return;
-    view->compositor().scheduleLayerFlush(true /* canThrottle */);
+    view->compositor().scheduleRenderingUpdate();
 }
 
 LayoutRect FrameView::fixedScrollableAreaBoundsInflatedForScrolling(const LayoutRect& uninflatedBounds) const
@@ -2845,11 +2845,7 @@
 
     auto flags = determineLayerFlushThrottleState(page);
     flags.add(RenderingUpdateThrottleState::UserIsInteracting);
-    if (page.chrome().client().adjustRenderingUpdateThrottling(flags))
-        return;
-
-    if (RenderView* view = renderView())
-        view->compositor().disableLayerFlushThrottlingTemporarilyForInteraction();
+    page.chrome().client().adjustRenderingUpdateThrottling(flags);
 }
 
 void FrameView::loadProgressingStatusChanged()
@@ -2870,14 +2866,7 @@
 
     auto flags = determineLayerFlushThrottleState(*page);
 
-    // See if the client is handling throttling.
-    if (page->chrome().client().adjustRenderingUpdateThrottling(flags))
-        return;
-
-    for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr())) {
-        if (RenderView* renderView = frame->contentRenderer())
-            renderView->compositor().setLayerFlushThrottlingEnabled(flags.contains(RenderingUpdateThrottleState::Enabled));
-    }
+    page->chrome().client().adjustRenderingUpdateThrottling(flags);
 }
 
 void FrameView::adjustTiledBackingCoverage()
@@ -5308,7 +5297,7 @@
     }
 
     if (auto* view = renderView())
-        view->compositor().scheduleLayerFlush(false /* canThrottle */);
+        view->compositor().scheduleRenderingUpdate();
 
     if (auto* page = frame().page())
         page->pageOverlayController().didChangeViewExposedRect();

Modified: trunk/Source/WebCore/page/FrameView.h (257356 => 257357)


--- trunk/Source/WebCore/page/FrameView.h	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/page/FrameView.h	2020-02-25 16:36:00 UTC (rev 257357)
@@ -147,8 +147,9 @@
     void setNeedsOneShotDrawingSynchronization();
 
     WEBCORE_EXPORT GraphicsLayer* graphicsLayerForPlatformWidget(PlatformWidget);
-    WEBCORE_EXPORT void scheduleLayerFlushAllowingThrottling();
 
+    WEBCORE_EXPORT void scheduleRenderingUpdate();
+
     WEBCORE_EXPORT TiledBacking* tiledBacking() const;
 
     ScrollingNodeID scrollingNodeID() const override;

Modified: trunk/Source/WebCore/page/PageOverlayController.cpp (257356 => 257357)


--- trunk/Source/WebCore/page/PageOverlayController.cpp	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/page/PageOverlayController.cpp	2020-02-25 16:36:00 UTC (rev 257357)
@@ -410,7 +410,7 @@
     return m_page.deviceScaleFactor();
 }
 
-void PageOverlayController::notifyFlushRequired(const GraphicsLayer*)
+void PageOverlayController::notifyRenderingUpdateRequired(const GraphicsLayer*)
 {
     m_page.renderingUpdateScheduler().scheduleTimedRenderingUpdate();
 }

Modified: trunk/Source/WebCore/page/PageOverlayController.h (257356 => 257357)


--- trunk/Source/WebCore/page/PageOverlayController.h	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/page/PageOverlayController.h	2020-02-25 16:36:00 UTC (rev 257357)
@@ -92,7 +92,7 @@
     void updateForceSynchronousScrollLayerPositionUpdates();
 
     // GraphicsLayerClient
-    void notifyFlushRequired(const GraphicsLayer*) override;
+    void notifyRenderingUpdateRequired(const GraphicsLayer*) override;
     void paintContents(const GraphicsLayer*, GraphicsContext&, const FloatRect& clipRect, GraphicsLayerPaintBehavior) override;
     float deviceScaleFactor() const override;
     bool shouldSkipLayerInDump(const GraphicsLayer*, LayerTreeAsTextBehavior) const override;

Modified: trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp (257356 => 257357)


--- trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp	2020-02-25 16:36:00 UTC (rev 257357)
@@ -122,7 +122,7 @@
         position.move(0, gFontSize + 2);
     }
 
-    void notifyFlushRequired(const GraphicsLayer*) override
+    void notifyRenderingUpdateRequired(const GraphicsLayer*) override
     {
         m_overlay.overlay().page()->chrome().client().scheduleRenderingUpdate();
     }

Modified: trunk/Source/WebCore/page/mac/ServicesOverlayController.h (257356 => 257357)


--- trunk/Source/WebCore/page/mac/ServicesOverlayController.h	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/page/mac/ServicesOverlayController.h	2020-02-25 16:36:00 UTC (rev 257357)
@@ -81,7 +81,7 @@
         Highlight(ServicesOverlayController&, Type, RetainPtr<DDHighlightRef>, Ref<Range>&&);
 
         // GraphicsLayerClient
-        void notifyFlushRequired(const GraphicsLayer*) override;
+        void notifyRenderingUpdateRequired(const GraphicsLayer*) override;
         void paintContents(const GraphicsLayer*, GraphicsContext&, const FloatRect& inClip, GraphicsLayerPaintBehavior) override;
         float deviceScaleFactor() const override;
 

Modified: trunk/Source/WebCore/page/mac/ServicesOverlayController.mm (257356 => 257357)


--- trunk/Source/WebCore/page/mac/ServicesOverlayController.mm	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/page/mac/ServicesOverlayController.mm	2020-02-25 16:36:00 UTC (rev 257357)
@@ -116,7 +116,7 @@
     m_controller = nullptr;
 }
 
-void ServicesOverlayController::Highlight::notifyFlushRequired(const GraphicsLayer*)
+void ServicesOverlayController::Highlight::notifyRenderingUpdateRequired(const GraphicsLayer*)
 {
     if (!m_controller)
         return;

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (257356 => 257357)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2020-02-25 16:36:00 UTC (rev 257357)
@@ -609,8 +609,6 @@
 
     void updateDebugIndicators();
 
-    virtual bool canThrottleLayerFlush() const { return false; }
-
     virtual bool isGraphicsLayerCA() const { return false; }
     virtual bool isGraphicsLayerCARemote() const { return false; }
     virtual bool isGraphicsLayerTextureMapper() const { return false; }

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h (257356 => 257357)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h	2020-02-25 16:36:00 UTC (rev 257357)
@@ -98,7 +98,7 @@
 
     // Notification that a layer property changed that requires a subsequent call to flushCompositingState()
     // to appear on the screen.
-    virtual void notifyFlushRequired(const GraphicsLayer*) { }
+    virtual void notifyRenderingUpdateRequired(const GraphicsLayer*) { }
     
     // Notification that this layer requires a flush before the next display refresh.
     virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) { }

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (257356 => 257357)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2020-02-25 16:36:00 UTC (rev 257357)
@@ -4199,12 +4199,6 @@
     propagateLayerChangeToReplicas(scheduleFlush);
 }
 
-bool GraphicsLayerCA::canThrottleLayerFlush() const
-{
-    // Tile layers are currently plain CA layers, attached directly by TileController. They require immediate flush as they may contain garbage.
-    return !(m_uncommittedChanges & TilesAdded);
-}
-
 void GraphicsLayerCA::addUncommittedChanges(LayerChangeFlags flags)
 {
     m_uncommittedChanges |= flags;
@@ -4232,14 +4226,13 @@
         return;
 
     bool hadUncommittedChanges = !!m_uncommittedChanges;
-    bool oldCanThrottleLayerFlush = canThrottleLayerFlush();
 
     addUncommittedChanges(flags);
 
     if (scheduleFlush == ScheduleFlush) {
-        bool needsFlush = !hadUncommittedChanges || oldCanThrottleLayerFlush != canThrottleLayerFlush();
+        bool needsFlush = !hadUncommittedChanges;
         if (needsFlush)
-            client().notifyFlushRequired(this);
+            client().notifyRenderingUpdateRequired(this);
     }
 }
 

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (257356 => 257357)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2020-02-25 16:36:00 UTC (rev 257357)
@@ -297,8 +297,6 @@
 
     WEBCORE_EXPORT void setReplicatedByLayer(RefPtr<GraphicsLayer>&&) override;
 
-    WEBCORE_EXPORT bool canThrottleLayerFlush() const override;
-
     WEBCORE_EXPORT void getDebugBorderInfo(Color&, float& width) const override;
     WEBCORE_EXPORT void dumpAdditionalProperties(WTF::TextStream&, LayerTreeAsTextBehavior) const override;
 

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (257356 => 257357)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2020-02-25 16:36:00 UTC (rev 257357)
@@ -66,7 +66,7 @@
     if (m_coordinator->isFlushingLayerChanges())
         return;
 
-    client().notifyFlushRequired(this);
+    client().notifyRenderingUpdateRequired(this);
 }
 
 void CoordinatedGraphicsLayer::didChangeAnimations()

Modified: trunk/Source/WebCore/platform/ios/LegacyTileCache.h (257356 => 257357)


--- trunk/Source/WebCore/platform/ios/LegacyTileCache.h	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/platform/ios/LegacyTileCache.h	2020-02-25 16:36:00 UTC (rev 257357)
@@ -170,7 +170,7 @@
     void adjustTileGridTransforms();
     void removeAllNonVisibleTilesInternal();
     void createTilesInActiveGrid(SynchronousTileCreationMode);
-    void scheduleLayerFlushForPendingRepaint();
+    void scheduleRenderingUpdateForPendingRepaint();
 
     void tileCreationTimerFired();
 

Modified: trunk/Source/WebCore/platform/ios/LegacyTileCache.mm (257356 => 257357)


--- trunk/Source/WebCore/platform/ios/LegacyTileCache.mm	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/platform/ios/LegacyTileCache.mm	2020-02-25 16:36:00 UTC (rev 257357)
@@ -48,7 +48,7 @@
 - (void)_willStartScrollingOrZooming;
 - (void)_didFinishScrollingOrZooming;
 - (void)_dispatchTileDidDraw;
-- (void)_scheduleLayerFlushForPendingTileCacheRepaint;
+- (void)_scheduleRenderingUpdateForPendingTileCacheRepaint;
 @end
 
 @interface LegacyTileCacheTombstone : NSObject {
@@ -609,10 +609,10 @@
     setNeedsDisplayInRect(IntRect(0, 0, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()));
 }
 
-void LegacyTileCache::scheduleLayerFlushForPendingRepaint()
+void LegacyTileCache::scheduleRenderingUpdateForPendingRepaint()
 {
     WAKView* view = [m_window contentView];
-    [view _scheduleLayerFlushForPendingTileCacheRepaint];
+    [view _scheduleRenderingUpdateForPendingTileCacheRepaint];
 }
 
 void LegacyTileCache::setNeedsDisplayInRect(const IntRect& dirtyRect)
@@ -623,7 +623,7 @@
     if (!addedFirstRect)
         return;
     // Compositing layer flush will call back to doPendingRepaints(). The flush may be throttled and not happen immediately.
-    scheduleLayerFlushForPendingRepaint();
+    scheduleRenderingUpdateForPendingRepaint();
 }
 
 void LegacyTileCache::invalidateTiles(const IntRect& dirtyRect)
@@ -693,7 +693,7 @@
         createTilesInActiveGrid(CoverVisibleOnly);
 
         if (!m_savedDisplayRects.isEmpty())
-            scheduleLayerFlushForPendingRepaint();
+            scheduleRenderingUpdateForPendingRepaint();
     }
 }
 

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (257356 => 257357)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2020-02-25 16:36:00 UTC (rev 257357)
@@ -3401,11 +3401,11 @@
         renderer().animation().notifyAnimationStarted(renderer(), time);
 }
 
-void RenderLayerBacking::notifyFlushRequired(const GraphicsLayer* layer)
+void RenderLayerBacking::notifyRenderingUpdateRequired(const GraphicsLayer*)
 {
     if (renderer().renderTreeBeingDestroyed())
         return;
-    compositor().scheduleLayerFlush(layer->canThrottleLayerFlush());
+    compositor().scheduleRenderingUpdate();
 }
 
 void RenderLayerBacking::notifyFlushBeforeDisplayRefresh(const GraphicsLayer* layer)

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (257356 => 257357)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.h	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h	2020-02-25 16:36:00 UTC (rev 257357)
@@ -237,7 +237,7 @@
     // GraphicsLayerClient interface
     void tiledBackingUsageChanged(const GraphicsLayer*, bool /*usingTiledBacking*/) override;
     void notifyAnimationStarted(const GraphicsLayer*, const String& animationKey, MonotonicTime startTime) override;
-    void notifyFlushRequired(const GraphicsLayer*) override;
+    void notifyRenderingUpdateRequired(const GraphicsLayer*) override;
     void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) override;
 
     void paintContents(const GraphicsLayer*, GraphicsContext&, const FloatRect& clip, GraphicsLayerPaintBehavior) override;

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (257356 => 257357)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2020-02-25 16:36:00 UTC (rev 257357)
@@ -100,14 +100,6 @@
 #if !USE(COMPOSITING_FOR_SMALL_CANVASES)
 static const int canvasAreaThresholdRequiringCompositing = 50 * 100;
 #endif
-// During page loading delay layer flushes up to this many seconds to allow them coalesce, reducing workload.
-#if PLATFORM(IOS_FAMILY)
-static const Seconds throttledLayerFlushInitialDelay { 500_ms };
-static const Seconds throttledLayerFlushDelay { 1.5_s };
-#else
-static const Seconds throttledLayerFlushInitialDelay { 500_ms };
-static const Seconds throttledLayerFlushDelay { 500_ms };
-#endif
 
 using namespace HTMLNames;
 
@@ -314,7 +306,6 @@
 RenderLayerCompositor::RenderLayerCompositor(RenderView& renderView)
     : m_renderView(renderView)
     , m_updateCompositingLayersTimer(*this, &RenderLayerCompositor::updateCompositingLayersTimerFired)
-    , m_layerFlushTimer(*this, &RenderLayerCompositor::layerFlushTimerFired)
 {
 #if PLATFORM(IOS_FAMILY)
     if (m_renderView.frameView().platformWidget())
@@ -476,24 +467,16 @@
     position = -scrollPosition;
 }
 
-void RenderLayerCompositor::notifyFlushRequired(const GraphicsLayer* layer)
+void RenderLayerCompositor::notifyRenderingUpdateRequired(const GraphicsLayer*)
 {
-    scheduleLayerFlush(layer->canThrottleLayerFlush());
+    scheduleRenderingUpdate();
 }
 
-void RenderLayerCompositor::scheduleLayerFlush(bool canThrottle)
+void RenderLayerCompositor::scheduleRenderingUpdate()
 {
     ASSERT(!m_flushingLayers);
 
-    if (canThrottle)
-        startInitialLayerFlushTimerIfNeeded();
-
-    if (canThrottle && isThrottlingLayerFlushes())
-        m_hasPendingLayerFlush = true;
-    else {
-        m_hasPendingLayerFlush = false;
-        page().renderingUpdateScheduler().scheduleRenderingUpdate();
-    }
+    page().renderingUpdateScheduler().scheduleRenderingUpdate();
 }
 
 FloatRect RenderLayerCompositor::visibleRectForLayerFlushing() const
@@ -522,9 +505,6 @@
         return;
 
     if (rootLayerAttachment() == RootLayerUnattached) {
-#if PLATFORM(IOS_FAMILY)
-        startLayerFlushTimerIfNeeded();
-#endif
         m_shouldFlushOnReattach = true;
         return;
     }
@@ -560,7 +540,6 @@
 #endif
 
     ++m_layerFlushCount;
-    startLayerFlushTimerIfNeeded();
 }
 
 #if PLATFORM(IOS_FAMILY)
@@ -628,7 +607,7 @@
     bool requiresFlush = rootLayer->visibleRectChangeRequiresFlush(visibleRect);
     LOG_WITH_STREAM(Compositing, stream << "RenderLayerCompositor::didChangeVisibleRect " << visibleRect << " requiresFlush " << requiresFlush);
     if (requiresFlush)
-        scheduleLayerFlush();
+        scheduleRenderingUpdate();
 }
 
 void RenderLayerCompositor::notifyFlushBeforeDisplayRefresh(const GraphicsLayer*)
@@ -643,7 +622,7 @@
 
 void RenderLayerCompositor::flushLayersSoon(GraphicsLayerUpdater&)
 {
-    scheduleLayerFlush(true);
+    scheduleRenderingUpdate();
 }
 
 void RenderLayerCompositor::layerTiledBackingUsageChanged(const GraphicsLayer* graphicsLayer, bool usingTiledBacking)
@@ -2077,7 +2056,7 @@
     // it will also manage updating the scroll layer position.
     if (hasCoordinatedScrolling()) {
         // We have to schedule a flush in order for the main TiledBacking to update its tile coverage.
-        scheduleLayerFlush();
+        scheduleRenderingUpdate();
         return;
     }
 
@@ -3935,7 +3914,7 @@
             updateOverflowControlsLayers();
 
             if (hasCoordinatedScrolling())
-                scheduleLayerFlush(true);
+                scheduleRenderingUpdate();
             else
                 updateScrollLayerPosition();
         }
@@ -4028,7 +4007,7 @@
     rootLayerAttachmentChanged();
     
     if (m_shouldFlushOnReattach) {
-        scheduleLayerFlush();
+        scheduleRenderingUpdate();
         m_shouldFlushOnReattach = false;
     }
 }
@@ -4683,60 +4662,6 @@
     return page().chrome().client().graphicsLayerFactory();
 }
 
-void RenderLayerCompositor::setLayerFlushThrottlingEnabled(bool enabled)
-{
-    m_layerFlushThrottlingEnabled = enabled;
-    if (m_layerFlushThrottlingEnabled)
-        return;
-    m_layerFlushTimer.stop();
-    if (!m_hasPendingLayerFlush)
-        return;
-    scheduleLayerFlush();
-}
-
-void RenderLayerCompositor::disableLayerFlushThrottlingTemporarilyForInteraction()
-{
-    if (m_layerFlushThrottlingTemporarilyDisabledForInteraction)
-        return;
-    m_layerFlushThrottlingTemporarilyDisabledForInteraction = true;
-}
-
-bool RenderLayerCompositor::isThrottlingLayerFlushes() const
-{
-    if (!m_layerFlushThrottlingEnabled)
-        return false;
-    if (!m_layerFlushTimer.isActive())
-        return false;
-    if (m_layerFlushThrottlingTemporarilyDisabledForInteraction)
-        return false;
-    return true;
-}
-
-void RenderLayerCompositor::startLayerFlushTimerIfNeeded()
-{
-    m_layerFlushThrottlingTemporarilyDisabledForInteraction = false;
-    m_layerFlushTimer.stop();
-    if (!m_layerFlushThrottlingEnabled)
-        return;
-    m_layerFlushTimer.startOneShot(throttledLayerFlushDelay);
-}
-
-void RenderLayerCompositor::startInitialLayerFlushTimerIfNeeded()
-{
-    if (!m_layerFlushThrottlingEnabled)
-        return;
-    if (m_layerFlushTimer.isActive())
-        return;
-    m_layerFlushTimer.startOneShot(throttledLayerFlushInitialDelay);
-}
-
-void RenderLayerCompositor::layerFlushTimerFired()
-{
-    if (!m_hasPendingLayerFlush)
-        return;
-    scheduleLayerFlush();
-}
-
 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
 RefPtr<DisplayRefreshMonitor> RenderLayerCompositor::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
 {

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (257356 => 257357)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2020-02-25 16:36:00 UTC (rev 257357)
@@ -179,7 +179,7 @@
 
     // GraphicsLayers buffer state, which gets pushed to the underlying platform layers
     // at specific times.
-    void scheduleLayerFlush(bool canThrottle = false);
+    void scheduleRenderingUpdate();
     void flushPendingLayerChanges(bool isFlushRoot = true);
 
     // Called when the GraphicsLayer for the given RenderLayer has flushed changes inside of flushPendingLayerChanges().
@@ -365,9 +365,6 @@
     bool hasNonMainLayersWithTiledBacking() const { return m_layersWithTiledBackingCount; }
 
     OptionSet<CompositingReason> reasonsForCompositing(const RenderLayer&) const;
-
-    void setLayerFlushThrottlingEnabled(bool);
-    void disableLayerFlushThrottlingTemporarilyForInteraction();
     
     void didPaintBacking(RenderLayerBacking*);
 
@@ -396,7 +393,7 @@
     bool updateCompositingPolicy();
     
     // GraphicsLayerClient implementation
-    void notifyFlushRequired(const GraphicsLayer*) override;
+    void notifyRenderingUpdateRequired(const GraphicsLayer*) override;
     void paintContents(const GraphicsLayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintBehavior) override;
     void customPositionForVisibleRectComputation(const GraphicsLayer*, FloatPoint&) const override;
     bool isTrackingRepaints() const override { return m_isTrackingRepaints; }
@@ -556,11 +553,6 @@
 
     bool shouldCompositeOverflowControls() const;
 
-    bool isThrottlingLayerFlushes() const;
-    void startInitialLayerFlushTimerIfNeeded();
-    void startLayerFlushTimerIfNeeded();
-    void layerFlushTimerFired();
-
 #if !LOG_DISABLED
     const char* logReasonsForCompositing(const RenderLayer&);
     void logLayerInfo(const RenderLayer&, const char*, int depth);
@@ -623,11 +615,6 @@
 
     std::unique_ptr<GraphicsLayerUpdater> m_layerUpdater; // Updates tiled layer visible area periodically while animations are running.
 
-    Timer m_layerFlushTimer;
-
-    bool m_layerFlushThrottlingEnabled { false };
-    bool m_layerFlushThrottlingTemporarilyDisabledForInteraction { false };
-    bool m_hasPendingLayerFlush { false };
     bool m_viewBackgroundIsTransparent { false };
 
 #if !LOG_DISABLED

Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp (257356 => 257357)


--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp	2020-02-25 16:36:00 UTC (rev 257357)
@@ -109,7 +109,7 @@
 void CompositingCoordinator::sizeDidChange(const IntSize& newSize)
 {
     m_rootLayer->setSize(newSize);
-    notifyFlushRequired(m_rootLayer.get());
+    notifyRenderingUpdateRequired(m_rootLayer.get());
 }
 
 bool CompositingCoordinator::flushPendingLayerChanges()
@@ -208,7 +208,7 @@
     m_shouldSyncFrame = true;
 }
 
-void CompositingCoordinator::notifyFlushRequired(const GraphicsLayer*)
+void CompositingCoordinator::notifyRenderingUpdateRequired(const GraphicsLayer*)
 {
     if (m_rootLayer && !isFlushingLayerChanges())
         m_client.notifyFlushRequired();
@@ -270,7 +270,7 @@
         compositionLayer->setSceneIntegration(nullptr);
     }
     m_registeredLayers.remove(layer->id());
-    notifyFlushRequired(layer);
+    notifyRenderingUpdateRequired(layer);
 }
 
 void CompositingCoordinator::attachLayer(CoordinatedGraphicsLayer* layer)
@@ -283,7 +283,7 @@
     }
     m_registeredLayers.add(layer->id(), layer);
     layer->setNeedsVisibleRectAdjustment();
-    notifyFlushRequired(layer);
+    notifyRenderingUpdateRequired(layer);
 }
 
 void CompositingCoordinator::renderNextFrame()

Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h (257356 => 257357)


--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h	2020-02-25 16:36:00 UTC (rev 257357)
@@ -90,7 +90,7 @@
 
 private:
     // GraphicsLayerClient
-    void notifyFlushRequired(const WebCore::GraphicsLayer*) override;
+    void notifyRenderingUpdateRequired(const WebCore::GraphicsLayer*) override;
     float deviceScaleFactor() const override;
     float pageScaleFactor() const override;
 

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (257356 => 257357)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-02-25 16:36:00 UTC (rev 257357)
@@ -1,3 +1,14 @@
+2020-02-25  Antti Koivisto  <an...@apple.com>
+
+        Remove throttling code from RenderLayerCompositor
+        https://bugs.webkit.org/show_bug.cgi?id=208135
+
+        Reviewed by Zalan Bujtas.
+
+        * WebView/WebView.mm:
+        (-[WebView _scheduleRenderingUpdateForPendingTileCacheRepaint]):
+        (-[WebView _scheduleLayerFlushForPendingTileCacheRepaint]): Deleted.
+
 2020-02-24  Simon Fraser  <simon.fra...@apple.com>
 
         Rename the clashing WebOverlayLayer classes

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (257356 => 257357)


--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2020-02-25 16:36:00 UTC (rev 257357)
@@ -9310,11 +9310,11 @@
 }
 
 #if PLATFORM(IOS_FAMILY)
-- (void)_scheduleLayerFlushForPendingTileCacheRepaint
+- (void)_scheduleRenderingUpdateForPendingTileCacheRepaint
 {
     auto* coreFrame = [self _mainCoreFrame];
     if (auto* view = coreFrame->view())
-        view->scheduleLayerFlushAllowingThrottling();
+        view->scheduleRenderingUpdate();
 }
 #endif
 

Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (257356 => 257357)


--- trunk/Source/WebKitLegacy/win/WebView.cpp	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp	2020-02-25 16:36:00 UTC (rev 257357)
@@ -7417,7 +7417,7 @@
     ASSERT_NOT_REACHED();
 }
 
-void WebView::notifyFlushRequired(const GraphicsLayer*)
+void WebView::notifyRenderingUpdateRequired(const GraphicsLayer*)
 {
     flushPendingGraphicsLayerChangesSoon();
 }

Modified: trunk/Source/WebKitLegacy/win/WebView.h (257356 => 257357)


--- trunk/Source/WebKitLegacy/win/WebView.h	2020-02-25 16:28:51 UTC (rev 257356)
+++ trunk/Source/WebKitLegacy/win/WebView.h	2020-02-25 16:36:00 UTC (rev 257357)
@@ -565,7 +565,7 @@
 
     // GraphicsLayerClient
     void notifyAnimationStarted(const WebCore::GraphicsLayer*, const String&, MonotonicTime) override;
-    void notifyFlushRequired(const WebCore::GraphicsLayer*) override;
+    void notifyRenderingUpdateRequired(const WebCore::GraphicsLayer*) override;
     void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, const WebCore::FloatRect& inClip, WebCore::GraphicsLayerPaintBehavior) override;
 
 #if USE(CA)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to