Backed out changeset b9e37b791afc (bug 1212646) for test failures on a CLOSED TREE
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 07 Oct 2015 23:23:09 -0400
changeset 266702 6aea4cfe56d505d0193e516375c3060472b9f3bf
parent 266701 5bc4d467648c0fd95b268cf01dc9d56e5b24c4af
child 266703 ac45ff7a16bc18996e834544855731c15d24ab6e
push id66266
push usereakhgari@mozilla.com
push dateThu, 08 Oct 2015 03:23:49 +0000
treeherdermozilla-inbound@6aea4cfe56d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1212646
milestone44.0a1
backs outb9e37b791afc35c55e946d7f457f2aff39135956
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
Backed out changeset b9e37b791afc (bug 1212646) for test failures on a CLOSED TREE
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -4654,36 +4654,44 @@ PresShell::RenderDocument(const nsRect& 
     aThebesContext->SetColor(Color::FromABGR(aBackgroundColor));
     aThebesContext->Fill();
     return NS_OK;
   }
 
   gfxContextAutoSaveRestore save(aThebesContext);
 
   CompositionOp oldOp = aThebesContext->CurrentOp();
+  if (oldOp == CompositionOp::OP_OVER) {
+    // Clip to the destination rectangle before we push the group,
+    // to limit the size of the temporary surface
+    aThebesContext->Clip();
+  }
 
   // we want the window to be composited as a single image using
   // whatever operator was set; set OP_OVER here, which is
   // either already the case, or overrides the operator in a group.
   // the original operator will be present when we PopGroup.
   // we can avoid using a temporary surface if we're using OP_OVER
   bool needsGroup = oldOp != CompositionOp::OP_OVER;
 
   if (needsGroup) {
     aThebesContext->PushGroup(NS_GET_A(aBackgroundColor) == 0xff ?
                               gfxContentType::COLOR :
                               gfxContentType::COLOR_ALPHA);
-
-    // Clip now while we paint to the temporary surface. For
-    // non-source-bounded operators (e.g., SOURCE), we need to do clip
-    // here after we've pushed the group, so that eventually popping
-    // the group and painting it will be able to clear the entire
-    // destination surface. PopGroup will take care of restoring.
-    aThebesContext->Clip();
-    aThebesContext->SetOp(CompositionOp::OP_OVER);
+    aThebesContext->Save();
+
+    if (oldOp != CompositionOp::OP_OVER) {
+      // Clip now while we paint to the temporary surface. For
+      // non-source-bounded operators (e.g., SOURCE), we need to do clip
+      // here after we've pushed the group, so that eventually popping
+      // the group and painting it will be able to clear the entire
+      // destination surface.
+      aThebesContext->Clip();
+      aThebesContext->SetOp(CompositionOp::OP_OVER);
+    }
   }
 
   nsDeviceContext* devCtx = mPresContext->DeviceContext();
 
   gfxPoint offset(-nsPresContext::AppUnitsToFloatCSSPixels(aRect.x),
                   -nsPresContext::AppUnitsToFloatCSSPixels(aRect.y));
   gfxFloat scale = gfxFloat(devCtx->AppUnitsPerDevPixel())/nsPresContext::AppUnitsPerCSSPixel();
 
@@ -4748,16 +4756,17 @@ PresShell::RenderDocument(const nsRect& 
     flags &= ~nsLayoutUtils::PAINT_WIDGET_LAYERS;
   }
 
   nsLayoutUtils::PaintFrame(&rc, rootFrame, nsRegion(aRect),
                             aBackgroundColor, flags);
 
   // if we had to use a group, paint it to the destination now
   if (needsGroup) {
+    aThebesContext->Restore();
     aThebesContext->PopGroupToSource();
     aThebesContext->Paint();
   }
 
   return NS_OK;
 }
 
 /*