Avoid calling isSimpleContainerCompositingLayer() an extra time
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Jun 2013 20:22:19 +0000 (20:22 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Jun 2013 20:22:19 +0000 (20:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=118218

Reviewed by Tim Horton.

containsPaintedContent() called isSimpleContainerCompositingLayer(), which
is not particularly cheap. But the caller already has this information,
so pass it in.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::containsPaintedContent):
* rendering/RenderLayerBacking.h:

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

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

index 0d026bb..2c01280 100644 (file)
@@ -1,5 +1,21 @@
 2013-06-29  Simon Fraser  <simon.fraser@apple.com>
 
+        Avoid calling isSimpleContainerCompositingLayer() an extra time
+        https://bugs.webkit.org/show_bug.cgi?id=118218
+
+        Reviewed by Tim Horton.
+
+        containsPaintedContent() called isSimpleContainerCompositingLayer(), which
+        is not particularly cheap. But the caller already has this information,
+        so pass it in.
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateDrawsContent):
+        (WebCore::RenderLayerBacking::containsPaintedContent):
+        * rendering/RenderLayerBacking.h:
+
+2013-06-29  Simon Fraser  <simon.fraser@apple.com>
+
         Avoid doing work in RenderBox::outlineBoundsForRepaint() when the repaintContainer is this
         https://bugs.webkit.org/show_bug.cgi?id=118215
 
index 17cde78..d0b78d8 100644 (file)
@@ -979,7 +979,7 @@ void RenderLayerBacking::updateDrawsContent(bool isSimpleContainer)
         return;
     }
 
-    bool hasPaintedContent = !isSimpleContainer && containsPaintedContent();
+    bool hasPaintedContent = containsPaintedContent(isSimpleContainer);
 
     // FIXME: we could refine this to only allocate backing for one of these layers if possible.
     m_graphicsLayer->setDrawsContent(hasPaintedContent);
@@ -1652,9 +1652,9 @@ bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const
     return hasVisibleNonCompositingDescendant(m_owningLayer);
 }
 
-bool RenderLayerBacking::containsPaintedContent() const
+bool RenderLayerBacking::containsPaintedContent(bool isSimpleContainer) const
 {
-    if (isSimpleContainerCompositingLayer() || paintsIntoWindow() || paintsIntoCompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflection())
+    if (isSimpleContainer || paintsIntoWindow() || paintsIntoCompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflection())
         return false;
 
     if (isDirectlyCompositedImage())
index 6c4c87a..4db6187 100644 (file)
@@ -254,7 +254,7 @@ private:
     // Returns true if this compositing layer has no visible content.
     bool isSimpleContainerCompositingLayer() const;
     // Returns true if this layer has content that needs to be rendered by painting into the backing store.
-    bool containsPaintedContent() const;
+    bool containsPaintedContent(bool isSimpleContainer) const;
     // Returns true if the RenderLayer just contains an image that we can composite directly.
     bool isDirectlyCompositedImage() const;
     void updateImageContents();