Bug 1022612. Part 34: Skip RecomputeVisibilityForItems in inactive layers. r=mattwoodrow
☠☠ backed out by 2bcded4e3b4a ☠ ☠
authorRobert O'Callahan <robert@ocallahan.org>
Mon, 23 Jun 2014 16:24:14 +1200
changeset 216630 66de53183a22701f2d27564fe770ee12d45cdba3
parent 216629 0ff86ced4d4622dbd344723dee8230432f9ba83b
child 216631 75b837686bdf2460a73328739ea27748c3ccc9da
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1022612
milestone33.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 1022612. Part 34: Skip RecomputeVisibilityForItems in inactive layers. r=mattwoodrow RecomputeVisibilityForItems for the retained ThebesLayer already recomputes visibility for all items in that layer, including items nested in other items.
layout/base/FrameLayerBuilder.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -4229,23 +4229,27 @@ FrameLayerBuilder::DrawThebesLayer(Thebe
 
     DrawForcedBackgroundColor(aContext, aLayer, userData->mForcedBackgroundColor);
   }
 
   // make the origin of the context coincide with the origin of the
   // ThebesLayer
   gfxContextMatrixAutoSaveRestore saveMatrix(aContext);
   nsIntPoint offset = GetTranslationForThebesLayer(aLayer);
-
   nsPresContext* presContext = entry->mContainerLayerFrame->PresContext();
-  int32_t appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
-
-  RecomputeVisibilityForItems(entry->mItems, builder, aRegionToDraw,
-                              offset, appUnitsPerDevPixel,
-                              userData->mXScale, userData->mYScale);
+
+  if (!layerBuilder->GetContainingThebesLayerData()) {
+    // Recompute visibility of items in our ThebesLayer. Note that this
+    // recomputes visibility for all descendants of our display items too,
+    // so there's no need to do this for the items in inactive ThebesLayers.
+    int32_t appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
+    RecomputeVisibilityForItems(entry->mItems, builder, aRegionToDraw,
+                                offset, appUnitsPerDevPixel,
+                                userData->mXScale, userData->mYScale);
+  }
 
   nsRefPtr<nsRenderingContext> rc = new nsRenderingContext();
   rc->Init(presContext->DeviceContext(), aContext);
 
   if (shouldDrawRectsSeparately) {
     nsIntRegionRectIterator it(aRegionToDraw);
     while (const nsIntRect* iterRect = it.Next()) {
       gfxContextAutoSaveRestore save(aContext);