Title: [134642] trunk/Source/WebCore
Revision
134642
Author
simon.fra...@apple.com
Date
2012-11-14 11:48:25 -0800 (Wed, 14 Nov 2012)

Log Message

Don't pass a paintingRoot when painting from RenderLayerBacking
https://bugs.webkit.org/show_bug.cgi?id=102256

Reviewed by David Hyatt.

The 'paintingRoot' parameter to the RenderLayer paint functions
is used when painting just a subtree (e.g. when painting dragged
selections). There is no need to pass it when a RenderLayerBacking
paints its contents or overlay scrollbars.

Passing it requires an expensive isDescendant() check, so passing
null is more efficient.

* rendering/RenderLayer.h:
(WebCore::RenderLayer::LayerPaintingInfo::LayerPaintingInfo):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerBacking.h:
(RenderLayerBacking):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (134641 => 134642)


--- trunk/Source/WebCore/ChangeLog	2012-11-14 19:44:47 UTC (rev 134641)
+++ trunk/Source/WebCore/ChangeLog	2012-11-14 19:48:25 UTC (rev 134642)
@@ -1,3 +1,26 @@
+2012-11-14  Simon Fraser  <simon.fra...@apple.com>
+
+        Don't pass a paintingRoot when painting from RenderLayerBacking
+        https://bugs.webkit.org/show_bug.cgi?id=102256
+
+        Reviewed by David Hyatt.
+
+        The 'paintingRoot' parameter to the RenderLayer paint functions
+        is used when painting just a subtree (e.g. when painting dragged
+        selections). There is no need to pass it when a RenderLayerBacking
+        paints its contents or overlay scrollbars.
+        
+        Passing it requires an expensive isDescendant() check, so passing
+        null is more efficient.
+        
+        * rendering/RenderLayer.h:
+        (WebCore::RenderLayer::LayerPaintingInfo::LayerPaintingInfo):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::paintIntoLayer):
+        (WebCore::RenderLayerBacking::paintContents):
+        * rendering/RenderLayerBacking.h:
+        (RenderLayerBacking):
+
 2012-11-14  Alec Flett  <alecfl...@chromium.org>
 
         Add DOMRequestState to maintain world/ScriptExecutionContext state

Modified: trunk/Source/WebCore/rendering/RenderLayer.h (134641 => 134642)


--- trunk/Source/WebCore/rendering/RenderLayer.h	2012-11-14 19:44:47 UTC (rev 134641)
+++ trunk/Source/WebCore/rendering/RenderLayer.h	2012-11-14 19:48:25 UTC (rev 134642)
@@ -525,7 +525,7 @@
         RenderRegion* = 0, PaintLayerFlags = 0);
     bool hitTest(const HitTestRequest&, HitTestResult&);
     bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&);
-    void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior, RenderObject* paintingRoot);
+    void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior, RenderObject* paintingRoot = 0);
 
     enum ShouldRespectOverflowClip { IgnoreOverflowClip, RespectOverflowClip };
 
@@ -741,7 +741,7 @@
     void updateCompositingAndLayerListsIfNeeded();
 
     struct LayerPaintingInfo {
-        LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, RenderObject* inPaintingRoot, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0)
+        LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, RenderObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0)
             : rootLayer(inRootLayer)
             , paintingRoot(inPaintingRoot)
             , paintDirtyRect(inDirtyRect)

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (134641 => 134642)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2012-11-14 19:44:47 UTC (rev 134641)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2012-11-14 19:48:25 UTC (rev 134642)
@@ -1510,8 +1510,7 @@
 
 void RenderLayerBacking::paintIntoLayer(RenderLayer* rootLayer, GraphicsContext* context,
                     const IntRect& paintDirtyRect, // In the coords of rootLayer.
-                    PaintBehavior paintBehavior, GraphicsLayerPaintingPhase paintingPhase,
-                    RenderObject* paintingRoot)
+                    PaintBehavior paintBehavior, GraphicsLayerPaintingPhase paintingPhase)
 {
     if (paintsIntoWindow() || paintsIntoCompositedAncestor()) {
         ASSERT_NOT_REACHED();
@@ -1531,11 +1530,11 @@
         paintFlags |= RenderLayer::PaintLayerPaintingOverflowContents;
     
     // FIXME: GraphicsLayers need a way to split for RenderRegions.
-    RenderLayer::LayerPaintingInfo paintingInfo(rootLayer, paintDirtyRect, paintBehavior, LayoutSize(), paintingRoot);
+    RenderLayer::LayerPaintingInfo paintingInfo(rootLayer, paintDirtyRect, paintBehavior, LayoutSize());
     m_owningLayer->paintLayerContents(context, paintingInfo, paintFlags);
 
     if (m_owningLayer->containsDirtyOverlayScrollbars())
-        m_owningLayer->paintOverlayScrollbars(context, paintDirtyRect, paintBehavior, paintingRoot);
+        m_owningLayer->paintOverlayScrollbars(context, paintDirtyRect, paintBehavior);
 
     ASSERT(!m_owningLayer->m_usedTransparency);
 }
@@ -1571,7 +1570,7 @@
             dirtyRect.intersect(compositedBounds());
 
         // We have to use the same root as for hit testing, because both methods can compute and cache clipRects.
-        paintIntoLayer(m_owningLayer, &context, dirtyRect, PaintBehaviorNormal, paintingPhase, renderer());
+        paintIntoLayer(m_owningLayer, &context, dirtyRect, PaintBehaviorNormal, paintingPhase);
 
         if (m_usingTiledCacheLayer)
             m_owningLayer->renderer()->frame()->view()->setLastPaintTime(currentTime());

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (134641 => 134642)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.h	2012-11-14 19:44:47 UTC (rev 134641)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h	2012-11-14 19:48:25 UTC (rev 134642)
@@ -247,7 +247,7 @@
     bool hasTileCacheFlatteningLayer() const { return (m_containmentLayer && m_usingTiledCacheLayer); }
     GraphicsLayer* tileCacheFlatteningLayer() const { return m_usingTiledCacheLayer ? m_containmentLayer.get() : 0; }
 
-    void paintIntoLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& paintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase, RenderObject* paintingRoot);
+    void paintIntoLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& paintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase);
 
     static CSSPropertyID graphicsLayerToCSSProperty(AnimatedPropertyID);
     static AnimatedPropertyID cssToGraphicsLayerProperty(CSSPropertyID);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to