Remove the unused RenderLayerCompositor::enclosingCompositorFlushingLayers()
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Sep 2018 18:34:15 +0000 (18:34 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Sep 2018 18:34:15 +0000 (18:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189689

Reviewed by Alex Christensen.

enclosingCompositorFlushingLayers() was added in r76196 but never used. Also use
a SetForScope<>.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const): Deleted.
* rendering/RenderLayerCompositor.h:

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h

index 3467a20..bd769ff 100644 (file)
@@ -1,3 +1,18 @@
+2018-09-18  Simon Fraser  <simon.fraser@apple.com>
+
+        Remove the unused RenderLayerCompositor::enclosingCompositorFlushingLayers()
+        https://bugs.webkit.org/show_bug.cgi?id=189689
+
+        Reviewed by Alex Christensen.
+
+        enclosingCompositorFlushingLayers() was added in r76196 but never used. Also use
+        a SetForScope<>.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
+        (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const): Deleted.
+        * rendering/RenderLayerCompositor.h:
+
 2018-09-18  Joseph Pecoraro  <pecoraro@apple.com>
 
         [macOS] Frequent leaks seen under WebCore::gpuIDForDisplayMask
index ebb453a..f8b5cd6 100644 (file)
@@ -482,16 +482,17 @@ void RenderLayerCompositor::flushPendingLayerChanges(bool isFlushRoot)
     AnimationUpdateBlock animationUpdateBlock(&frameView.frame().animation());
 
     ASSERT(!m_flushingLayers);
-    m_flushingLayers = true;
+    {
+        SetForScope<bool> flushingLayersScope(m_flushingLayers, true);
 
-    if (auto* rootLayer = rootGraphicsLayer()) {
-        FloatRect visibleRect = visibleRectForLayerFlushing();
-        LOG_WITH_STREAM(Compositing,  stream << "\nRenderLayerCompositor " << this << " flushPendingLayerChanges (is root " << isFlushRoot << ") visible rect " << visibleRect);
-        rootLayer->flushCompositingState(visibleRect);
+        if (auto* rootLayer = rootGraphicsLayer()) {
+            FloatRect visibleRect = visibleRectForLayerFlushing();
+            LOG_WITH_STREAM(Compositing,  stream << "\nRenderLayerCompositor " << this << " flushPendingLayerChanges (is root " << isFlushRoot << ") visible rect " << visibleRect);
+            rootLayer->flushCompositingState(visibleRect);
+        }
+        
+        ASSERT(m_flushingLayers);
     }
-    
-    ASSERT(m_flushingLayers);
-    m_flushingLayers = false;
 
     updateScrollCoordinatedLayersAfterFlushIncludingSubframes();
 
@@ -628,17 +629,6 @@ void RenderLayerCompositor::layerTiledBackingUsageChanged(const GraphicsLayer* g
     }
 }
 
-RenderLayerCompositor* RenderLayerCompositor::enclosingCompositorFlushingLayers() const
-{
-    for (auto* frame = &m_renderView.frameView().frame(); frame; frame = frame->tree().parent()) {
-        auto* compositor = frame->contentRenderer() ? &frame->contentRenderer()->compositor() : nullptr;
-        if (compositor->isFlushingLayers())
-            return compositor;
-    }
-    
-    return nullptr;
-}
-
 void RenderLayerCompositor::scheduleCompositingLayerUpdate()
 {
     if (!m_updateCompositingLayersTimer.isActive())
index 6494e65..5a4ba80 100644 (file)
@@ -125,10 +125,6 @@ public:
     void scheduleLayerFlush(bool canThrottle);
     void flushPendingLayerChanges(bool isFlushRoot = true);
     
-    // flushPendingLayerChanges() flushes the entire GraphicsLayer tree, which can cross frame boundaries.
-    // This call returns the rootmost compositor that is being flushed (including self).
-    RenderLayerCompositor* enclosingCompositorFlushingLayers() const;
-
     // Called when the GraphicsLayer for the given RenderLayer has flushed changes inside of flushPendingLayerChanges().
     void didFlushChangesForLayer(RenderLayer&, const GraphicsLayer*);
 
@@ -407,7 +403,6 @@ private:
 
     void notifyIFramesOfCompositingChange();
 
-    bool isFlushingLayers() const { return m_flushingLayers; }
     void updateScrollCoordinatedLayersAfterFlushIncludingSubframes();
     void updateScrollCoordinatedLayersAfterFlush();