Bug 1022612. Part 34: Skip RecomputeVisibilityForItems in inactive layers. r=mattwoodrow
☠☠ backed out by e5807a2b482e ☠ ☠
authorRobert O'Callahan <robert@ocallahan.org>
Mon, 23 Jun 2014 16:24:14 +1200
changeset 215945 6e190d419511e96b222fd7461fdb74b0e3a0dd88
parent 215944 7e9751c1302a7cf48228eaa0d9a2a88be95e93b2
child 215946 1dd246b1436c0d8b201fb5b9beecfc142afe95e4
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
@@ -4224,23 +4224,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);