Bug 1049450 - Revert pre-rendering heuristic changes from bug 1034247. r=roc, a=sledru
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 12 Aug 2014 18:02:55 +1200
changeset 217549 e2f568b39d92b12448ebf00771f6d519b545db77
parent 217548 2bea25f0a82b211ba17763dc91cd8df31edcb577
child 217550 83f0220caa1250e97cbb8cd9776ccc7777df680a
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)
reviewersroc, sledru
bugs1049450, 1034247
milestone33.0a2
Bug 1049450 - Revert pre-rendering heuristic changes from bug 1034247. r=roc, a=sledru
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -4723,17 +4723,21 @@ nsDisplayTransform::ShouldPrerenderTrans
 
   nsSize refSize = aBuilder->RootReferenceFrame()->GetSize();
   // Only prerender if the transformed frame's size is <= the
   // reference frame size (~viewport), allowing a 1/8th fuzz factor
   // for shadows, borders, etc.
   refSize += nsSize(refSize.width / 8, refSize.height / 8);
   nsSize frameSize = aFrame->GetVisualOverflowRectRelativeToSelf().Size();
   if (frameSize <= refSize) {
-    return true;
+    nscoord max = aFrame->PresContext()->DevPixelsToAppUnits(4096);
+    nsRect visual = aFrame->GetVisualOverflowRect();
+    if (visual.width <= max && visual.height <= max) {
+      return true;
+    }
   }
 
   if (aLogAnimations) {
     nsCString message;
     message.AppendLiteral("Performance warning: Async animation disabled because frame size (");
     message.AppendInt(nsPresContext::AppUnitsToIntCSSPixels(frameSize.width));
     message.AppendLiteral(", ");
     message.AppendInt(nsPresContext::AppUnitsToIntCSSPixels(frameSize.height));