Title: [108764] trunk/Source/WebCore
Revision
108764
Author
[email protected]
Date
2012-02-24 03:01:28 -0800 (Fri, 24 Feb 2012)

Log Message

[chromium] Avoid culling work for fully-non-opaque tiles, and add tracing for draw culling
https://bugs.webkit.org/show_bug.cgi?id=79183

Patch by Dana Jansens <[email protected]> on 2012-02-24
Reviewed by James Robinson.

Addresses performance issues with draw culling by avoiding the work
of mapRect and other function calls when the quad has no opaque area.
And adds a TRACE_EVENT to watch the time spent in draw culling.

* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::optimizeRenderPasses):
* platform/graphics/chromium/cc/CCQuadCuller.cpp:
(WebCore::CCQuadCuller::cullOccludedQuads):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (108763 => 108764)


--- trunk/Source/WebCore/ChangeLog	2012-02-24 10:54:35 UTC (rev 108763)
+++ trunk/Source/WebCore/ChangeLog	2012-02-24 11:01:28 UTC (rev 108764)
@@ -1,3 +1,19 @@
+2012-02-24  Dana Jansens  <[email protected]>
+
+        [chromium] Avoid culling work for fully-non-opaque tiles, and add tracing for draw culling
+        https://bugs.webkit.org/show_bug.cgi?id=79183
+
+        Reviewed by James Robinson.
+
+        Addresses performance issues with draw culling by avoiding the work
+        of mapRect and other function calls when the quad has no opaque area.
+        And adds a TRACE_EVENT to watch the time spent in draw culling.
+
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::optimizeRenderPasses):
+        * platform/graphics/chromium/cc/CCQuadCuller.cpp:
+        (WebCore::CCQuadCuller::cullOccludedQuads):
+
 2012-02-24  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Scripts panel navigator overlay should be shown automatically only one time.

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp (108763 => 108764)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-02-24 10:54:35 UTC (rev 108763)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-02-24 11:01:28 UTC (rev 108764)
@@ -229,6 +229,8 @@
 
 void CCLayerTreeHostImpl::optimizeRenderPasses(CCRenderPassList& passes)
 {
+    TRACE_EVENT1("webkit", "CCLayerTreeHostImpl::optimizeRenderPasses", "passes.size()", static_cast<long long unsigned>(passes.size()));
+
     bool haveDamageRect = layerRendererCapabilities().usingPartialSwap;
 
     for (unsigned i = 0; i < passes.size(); ++i) {

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp (108763 => 108764)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp	2012-02-24 10:54:35 UTC (rev 108763)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp	2012-02-24 11:01:28 UTC (rev 108764)
@@ -96,20 +96,21 @@
 
         IntRect transformedVisibleQuadRect = rectSubtractRegion(opaqueCoverageThusFar, transformedQuadRect);
         bool keepQuad = !transformedVisibleQuadRect.isEmpty();
+        if (!keepQuad)
+            continue;
 
         // See if we can reduce the number of pixels to draw by reducing the size of the draw
         // quad - we do this by changing its visible rect.
-        if (keepQuad && transformedVisibleQuadRect != transformedQuadRect && drawQuad->isLayerAxisAlignedIntRect())
+        if (transformedVisibleQuadRect != transformedQuadRect && drawQuad->isLayerAxisAlignedIntRect())
             drawQuad->setQuadVisibleRect(drawQuad->quadTransform().inverse().mapRect(transformedVisibleQuadRect));
 
         // When adding rect to opaque region, deflate it to stay conservative.
-        if (keepQuad && drawQuad->isLayerAxisAlignedIntRect()) {
+        if (drawQuad->isLayerAxisAlignedIntRect() && !drawQuad->opaqueRect().isEmpty()) {
             FloatRect floatOpaqueRect = drawQuad->quadTransform().mapRect(FloatRect(drawQuad->opaqueRect()));
             opaqueCoverageThusFar.unite(Region(enclosedIntRect(floatOpaqueRect)));
         }
 
-        if (keepQuad)
-            culledList.append(quadList[i].release());
+        culledList.append(quadList[i].release());
     }
     quadList.clear(); // Release anything that remains.
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to