Move composite bounds calculation to RenderLayerBacking.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Jul 2014 19:15:24 +0000 (19:15 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Jul 2014 19:15:24 +0000 (19:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134864

Reviewed by Darin Adler.

No change in functionality.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCompositedBounds):
* rendering/RenderLayerCompositor.cpp: it was just proxying the calculateLayerBounds()
to the RenderLayer.
(WebCore::RenderLayerCompositor::calculateCompositedBounds): Deleted.
* rendering/RenderLayerCompositor.h:

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

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

index 505a8fa..69f0a9b 100644 (file)
@@ -1,3 +1,19 @@
+2014-07-14  Zalan Bujtas  <zalan@apple.com>
+
+        Move composite bounds calculation to RenderLayerBacking.
+        https://bugs.webkit.org/show_bug.cgi?id=134864
+
+        Reviewed by Darin Adler.
+
+        No change in functionality.
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateCompositedBounds):
+        * rendering/RenderLayerCompositor.cpp: it was just proxying the calculateLayerBounds()
+        to the RenderLayer.
+        (WebCore::RenderLayerCompositor::calculateCompositedBounds): Deleted.
+        * rendering/RenderLayerCompositor.h:
+
 2014-07-14  Tim Horton  <timothy_horton@apple.com>
 
         Fix the build.
index 47c03d9..b06e0bd 100644 (file)
@@ -440,8 +440,7 @@ static bool hasNonZeroTransformOrigin(const RenderObject& renderer)
 
 void RenderLayerBacking::updateCompositedBounds()
 {
-    LayoutRect layerBounds = compositor().calculateCompositedBounds(m_owningLayer, m_owningLayer);
-
+    LayoutRect layerBounds = m_owningLayer.calculateLayerBounds(&m_owningLayer, LayoutSize(), RenderLayer::DefaultCalculateLayerBoundsFlags | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
     // Clip to the size of the document or enclosing overflow-scroll layer.
     // If this or an ancestor is transformed, we can't currently compute the correct rect to intersect with.
     // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet exist.
index 72746ed..b667cf7 100644 (file)
@@ -968,15 +968,6 @@ void RenderLayerCompositor::repaintInCompositedAncestor(RenderLayer& layer, cons
         m_renderView.frameView().setNeedsOneShotDrawingSynchronization();
 }
 
-// The bounds of the GraphicsLayer created for a compositing layer is the union of the bounds of all the descendant
-// RenderLayers that are rendered by the composited RenderLayer.
-LayoutRect RenderLayerCompositor::calculateCompositedBounds(const RenderLayer& layer, const RenderLayer& ancestorLayer) const
-{
-    if (!canBeComposited(layer))
-        return LayoutRect();
-    return layer.calculateLayerBounds(&ancestorLayer, layer.offsetFromAncestor(&ancestorLayer), RenderLayer::DefaultCalculateLayerBoundsFlags | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
-}
-
 void RenderLayerCompositor::layerWasAdded(RenderLayer&, RenderLayer&)
 {
     setCompositingLayersNeedRebuild();
index 5116bea..efd32df 100644 (file)
@@ -160,10 +160,6 @@ public:
     bool needsFixedRootBackgroundLayer(const RenderLayer&) const;
     GraphicsLayer* fixedRootBackgroundLayer() const;
     
-    // Return the bounding box required for compositing layer and its childern, relative to ancestorLayer.
-    // If layerBoundingBox is not 0, on return it contains the bounding box of this layer only.
-    LayoutRect calculateCompositedBounds(const RenderLayer&, const RenderLayer& ancestorLayer) const;
-
     // Repaint the appropriate layers when the given RenderLayer starts or stops being composited.
     void repaintOnCompositingChange(RenderLayer&);