Bug 1136766 - Don't allow more draw calls after culling. r=mattwoodrow
authorBenoit Girard <b56girard@gmail.com>
Fri, 27 Feb 2015 14:17:35 -0500
changeset 259359 d4985245dfd55ba44e0417c42c956e03d094b0df
parent 259358 b47b07514a11156dd40b2c22c002a98a53e4f036
child 259360 60383e5c8e4ef597f298e6e0c4e936775c381c3d
push id29277
push userryanvm@gmail.com
push dateWed, 26 Aug 2015 18:32:23 +0000
treeherdermozilla-central@fea87cbeaa6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1136766
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1136766 - Don't allow more draw calls after culling. r=mattwoodrow
gfx/layers/composite/LayerManagerComposite.cpp
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -221,17 +221,21 @@ LayerManagerComposite::ApplyOcclusionCul
     }
   }
 
   // Subtract any areas that we know to be opaque from our
   // visible region.
   LayerComposite *composite = aLayer->AsLayerComposite();
   if (!localOpaque.IsEmpty()) {
     nsIntRegion visible = composite->GetShadowVisibleRegion();
-    visible.Sub(visible, localOpaque);
+    nsIntRegion afterCulling;
+    afterCulling.Sub(visible, localOpaque);
+    // Intersect the original region with the bounds of the culled region so
+    // that we don't increase the region's complexity.
+    visible.AndWith(afterCulling.GetBounds());
     composite->SetShadowVisibleRegion(visible);
   }
 
   // Compute occlusions for our descendants (in front-to-back order) and allow them to
   // contribute to localOpaque.
   for (Layer* child = aLayer->GetLastChild(); child; child = child->GetPrevSibling()) {
     ApplyOcclusionCulling(child, localOpaque);
   }