Title: [152227] trunk/Source/WebCore
Revision
152227
Author
[email protected]
Date
2013-07-01 09:32:07 -0700 (Mon, 01 Jul 2013)

Log Message

Avoid calling RenderLayerBacking::resetContentsRect() if possible
https://bugs.webkit.org/show_bug.cgi?id=118217

Patch by Noam Rosenthal <[email protected]> on 2013-07-01
Reviewed by Simon Fraser.

Call resetContentsRect() only if the layer has a contentsLayer.
Otherwise the contentsRect is redundant for the GraphicsLayer.

No new tests - optimization only. This is covered by plenty of existing
tests in webgl/ and compositing/.

* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
(WebCore::GraphicsLayerTextureMapper::hasContentsLayer):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
    Added hasContentsLayer calls for TextureMapper/CoordinatedGraphics

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (152226 => 152227)


--- trunk/Source/WebCore/ChangeLog	2013-07-01 16:25:21 UTC (rev 152226)
+++ trunk/Source/WebCore/ChangeLog	2013-07-01 16:32:07 UTC (rev 152227)
@@ -1,3 +1,24 @@
+2013-07-01  Noam Rosenthal  <[email protected]>
+
+        Avoid calling RenderLayerBacking::resetContentsRect() if possible
+        https://bugs.webkit.org/show_bug.cgi?id=118217
+
+        Reviewed by Simon Fraser.
+
+        Call resetContentsRect() only if the layer has a contentsLayer.
+        Otherwise the contentsRect is redundant for the GraphicsLayer.
+
+        No new tests - optimization only. This is covered by plenty of existing
+        tests in webgl/ and compositing/.
+
+        * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
+        (WebCore::GraphicsLayerTextureMapper::hasContentsLayer):
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
+            Added hasContentsLayer calls for TextureMapper/CoordinatedGraphics
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
+
 2013-07-01  Allan Sandfeld Jensen  <[email protected]>
 
         [Qt] Avoid creating a QWindow for offscreen GraphicsContext3D

Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h (152226 => 152227)


--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h	2013-07-01 16:25:21 UTC (rev 152226)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h	2013-07-01 16:32:07 UTC (rev 152227)
@@ -76,6 +76,7 @@
     virtual void flushCompositingState(const FloatRect&);
     virtual void flushCompositingStateForThisLayerOnly();
     virtual void setName(const String& name);
+    virtual bool hasContentsLayer() const { return m_contentsLayer; }
     virtual PlatformLayer* platformLayer() const { return m_contentsLayer; }
 
     inline int changeMask() const { return m_changeMask; }

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h (152226 => 152227)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h	2013-07-01 16:25:21 UTC (rev 152226)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h	2013-07-01 16:32:07 UTC (rev 152227)
@@ -110,6 +110,7 @@
     virtual void removeAnimation(const String&) OVERRIDE;
     virtual void suspendAnimations(double time) OVERRIDE;
     virtual void resumeAnimations() OVERRIDE;
+    virtual bool hasContentsLayer() const OVERRIDE { return m_canvasPlatformLayer || m_compositedImage; }
 
     void syncPendingStateChangesIncludingSubLayers();
     void updateContentBuffersIncludingSubLayers();

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (152226 => 152227)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2013-07-01 16:25:21 UTC (rev 152226)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2013-07-01 16:32:07 UTC (rev 152227)
@@ -861,7 +861,7 @@
 
     bool didUpdateContentsRect = false;
     updateDirectlyCompositedContents(isSimpleContainer, didUpdateContentsRect);
-    if (!didUpdateContentsRect)
+    if (!didUpdateContentsRect && m_graphicsLayer->hasContentsLayer())
         resetContentsRect();
 
     updateDrawsContent(isSimpleContainer);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to