Bug 976877 - Don't build optimized layers (color/image) inside inactive layer trees. r=roc
authorMatt Woodrow <mwoodrow@mozilla.com>
Sat, 01 Mar 2014 08:49:58 +1300
changeset 171604 3637434788e5ee9964fe8f4fb05c1d5a2008cbe7
parent 171603 4e0303f0aebc4a8880c97fc201575b528ec9715b
child 171605 9a491cb7be311581a31b70605b347026320a405d
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersroc
bugs976877
milestone30.0a1
Bug 976877 - Don't build optimized layers (color/image) inside inactive layer trees. r=roc
layout/base/FrameLayerBuilder.cpp
layout/reftests/bugs/reftest.list
layout/reftests/invalidation/test-image-layers-ref.html
layout/reftests/invalidation/test-image-layers.html
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -1839,17 +1839,18 @@ ContainerState::PopThebesLayerData()
 
   AdjustLayerDataForFixedPositioning(data->mFixedPosFrameForLayerData,
                                      data->mDrawRegion,
                                      &data->mVisibleRegion,
                                      &data->mIsSolidColorInVisibleRegion);
   nsRefPtr<Layer> layer;
   nsRefPtr<ImageContainer> imageContainer = data->CanOptimizeImageLayer(mBuilder);
 
-  if ((data->mIsSolidColorInVisibleRegion || imageContainer) &&
+  bool isRetained = data->mLayer->Manager()->IsWidgetLayerManager();
+  if (isRetained && (data->mIsSolidColorInVisibleRegion || imageContainer) &&
       (data->mLayer->GetValidRegion().IsEmpty() || mLayerBuilder->CheckInLayerTreeCompressionMode())) {
     NS_ASSERTION(!(data->mIsSolidColorInVisibleRegion && imageContainer),
                  "Can't be a solid color as well as an image!");
     if (imageContainer) {
       nsRefPtr<ImageLayer> imageLayer = CreateOrRecycleImageLayer(data->mLayer);
       imageLayer->SetContainer(imageContainer);
       data->mImage->ConfigureLayer(imageLayer, mParameters.mOffset);
       imageLayer->SetPostScale(mParameters.mXScale,
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1716,17 +1716,17 @@ needs-focus == 731726-1.html 731726-1-re
 == 748692-1b.html 748692-1-ref.html
 skip-if(B2G) == 748803-1.html 748803-1-ref.html
 == 750551-1.html 750551-1-ref.html
 skip-if(B2G) == 751012-1a.html 751012-1-ref.html
 skip-if(B2G) == 751012-1b.html 751012-1-ref.html
 random-if(Android) == 753329-1.html about:blank
 == 758561-1.html 758561-1-ref.html
 fuzzy-if(true,1,19) fails-if(d2d) random-if(Android&&AndroidVersion<15) == 759036-1.html 759036-1-ref.html
-fuzzy-if(true,17,5860) random-if(Android&&AndroidVersion<15) == 759036-2.html 759036-2-ref.html
+fuzzy-if(true,17,5879) random-if(Android&&AndroidVersion<15) == 759036-2.html 759036-2-ref.html
 random-if(Android&&AndroidVersion<15) == 776265-1a.html 776265-1-ref.html
 == 776265-1b.html 776265-1-ref.html
 == 776265-1c.html 776265-1-ref.html
 == 776265-1d.html 776265-1-ref.html
 == 776265-2a.html 776265-2-ref.html
 == 776265-2b.html 776265-2-ref.html
 == 776265-2c.html 776265-2-ref.html
 == 776265-2d.html 776265-2-ref.html
--- a/layout/reftests/invalidation/test-image-layers-ref.html
+++ b/layout/reftests/invalidation/test-image-layers-ref.html
@@ -1,8 +1,8 @@
 <!DOCTYPE HTML>
 <html>
 <body style="background:black">
 <div>
-<img id="image" src="./image_rgrg-256x256.png" style="-moz-transform: translatex(1px)"></img>
+<img id="image" src="./image_rgrg-256x256.png" style="-moz-transform: perspective(1px)"></img>
 </div>
 </body>
 </html>
--- a/layout/reftests/invalidation/test-image-layers.html
+++ b/layout/reftests/invalidation/test-image-layers.html
@@ -1,13 +1,13 @@
 <!DOCTYPE HTML>
 <html class="reftest-wait">
 <body>
 <div>
-<img id="image" class="reftest-no-paint" src="./image_rgrg-256x256.png" style="-moz-transform: translatex(1px)"></img>
+<img id="image" class="reftest-no-paint" src="./image_rgrg-256x256.png" style="-moz-transform: perspective(1px)"></img>
 </div>
 <script type="application/javascript">
 
 function doTest() {
   document.body.style.background = "black";
   document.documentElement.removeAttribute("class");
 }
 document.addEventListener("MozReftestInvalidate", doTest, false);