Title: [169096] trunk/Source/WebCore
Revision
169096
Author
[email protected]
Date
2014-05-19 19:31:17 -0700 (Mon, 19 May 2014)

Log Message

Correctly maintain the "isInWindow" state for all TiledBackings
https://bugs.webkit.org/show_bug.cgi?id=133095

Reviewed by Tim Horton.

We never updated the "isInWindow" state for TiledBacking that wasn't the RenderView's
backing. Fix it by having RenderLayerCompositor::setIsInWindow() recurse through all
layers (if necessary), updating their state. Also set the state on newly created
TiledBackings.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTiledBackingUsageChanged):
(WebCore::RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::pageTiledBacking): Deleted.
* rendering/RenderLayerCompositor.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (169095 => 169096)


--- trunk/Source/WebCore/ChangeLog	2014-05-20 02:22:35 UTC (rev 169095)
+++ trunk/Source/WebCore/ChangeLog	2014-05-20 02:31:17 UTC (rev 169096)
@@ -1,3 +1,22 @@
+2014-05-19  Simon Fraser  <[email protected]>
+
+        Correctly maintain the "isInWindow" state for all TiledBackings
+        https://bugs.webkit.org/show_bug.cgi?id=133095
+
+        Reviewed by Tim Horton.
+        
+        We never updated the "isInWindow" state for TiledBacking that wasn't the RenderView's
+        backing. Fix it by having RenderLayerCompositor::setIsInWindow() recurse through all
+        layers (if necessary), updating their state. Also set the state on newly created
+        TiledBackings.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::layerTiledBackingUsageChanged):
+        (WebCore::RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants):
+        (WebCore::RenderLayerCompositor::setIsInWindow):
+        (WebCore::RenderLayerCompositor::pageTiledBacking): Deleted.
+        * rendering/RenderLayerCompositor.h:
+
 2014-05-19  Dean Jackson  <[email protected]>
 
         [iOS] Use status display for live streams

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (169095 => 169096)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2014-05-20 02:22:35 UTC (rev 169095)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2014-05-20 02:31:17 UTC (rev 169096)
@@ -584,11 +584,14 @@
     scheduleLayerFlush(true);
 }
 
-void RenderLayerCompositor::layerTiledBackingUsageChanged(const GraphicsLayer*, bool usingTiledBacking)
+void RenderLayerCompositor::layerTiledBackingUsageChanged(const GraphicsLayer* graphicsLayer, bool usingTiledBacking)
 {
-    if (usingTiledBacking)
+    if (usingTiledBacking) {
         ++m_layersWithTiledBackingCount;
-    else {
+
+        if (Page* page = this->page())
+            graphicsLayer->tiledBacking()->setIsInWindow(page->isInWindow());
+    } else {
         ASSERT(m_layersWithTiledBackingCount > 0);
         --m_layersWithTiledBackingCount;
     }
@@ -1913,17 +1916,23 @@
 }
 #endif
 
-TiledBacking* RenderLayerCompositor::pageTiledBacking() const
+void RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants(RenderLayer& layer, bool isInWindow)
 {
-    RenderLayerBacking* renderViewBacking = m_renderView.layer()->backing();
-    return renderViewBacking ? renderViewBacking->tiledBacking() : nullptr;
+    if (layer.isComposited() && layer.backing()->usingTiledBacking())
+        layer.backing()->tiledBacking()->setIsInWindow(isInWindow);
+
+    // No need to recurse if we don't have any other tiled layers.
+    if (hasNonMainLayersWithTiledBacking())
+        return;
+
+    for (RenderLayer* childLayer = layer.firstChild(); childLayer; childLayer = childLayer->nextSibling())
+        setIsInWindowForLayerIncludingDescendants(*childLayer, isInWindow);
 }
 
 void RenderLayerCompositor::setIsInWindow(bool isInWindow)
 {
-    if (TiledBacking* tiledBacking = pageTiledBacking())
-        tiledBacking->setIsInWindow(isInWindow);
-
+    setIsInWindowForLayerIncludingDescendants(*m_renderView.layer(), isInWindow);
+    
     if (!inCompositingMode())
         return;
 

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (169095 => 169096)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2014-05-20 02:22:35 UTC (rev 169095)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2014-05-20 02:31:17 UTC (rev 169096)
@@ -329,6 +329,7 @@
     bool updateBacking(RenderLayer&, CompositingChangeRepaint shouldRepaint);
 
     void clearBackingForLayerIncludingDescendants(RenderLayer&);
+    void setIsInWindowForLayerIncludingDescendants(RenderLayer&, bool isInWindow);
 
     // Repaint the given rect (which is layer's coords), and regions of child layers that intersect that rect.
     void recursiveRepaintLayer(RenderLayer&, const IntRect* = nullptr);
@@ -386,7 +387,6 @@
     bool isFlushingLayers() const { return m_flushingLayers; }
     
     Page* page() const;
-    TiledBacking* pageTiledBacking() const;
     
     GraphicsLayerFactory* graphicsLayerFactory() const;
     ScrollingCoordinator* scrollingCoordinator() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to