From 0f74b2d77a6219290ae6b0953bfe1b3f174c301a Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Tue, 24 Jun 2014 12:12:52 +1200 Subject: [PATCH] Bug 1028216 - Backout 660cc013d558 (bug 952721) for causing b2g animation regressions. --- layout/base/nsDisplayList.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 805869bc8c8e..2ea9426c8b24 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -4749,26 +4749,26 @@ nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBui } nsSize refSize = aBuilder->RootReferenceFrame()->GetSize(); - // Only prerender if the transformed frame's size (in the reference - // frames coordinate space) is <= the reference frame size (~viewport), - // allowing a 1/8th fuzz factor for shadows, borders, etc. + // 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); - nsRect frameRect = aFrame->GetVisualOverflowRectRelativeToSelf(); - - frameRect = - nsLayoutUtils::TransformFrameRectToAncestor(aFrame, frameRect, - aBuilder->RootReferenceFrame()); - - if (frameRect.Size() <= refSize) { - return true; + nsSize frameSize = aFrame->GetVisualOverflowRectRelativeToSelf().Size(); + if (frameSize <= refSize) { + // Bug 717521 - pre-render max 4096 x 4096 device pixels. + 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(frameRect.width)); + message.AppendInt(nsPresContext::AppUnitsToIntCSSPixels(frameSize.width)); message.AppendLiteral(", "); - message.AppendInt(nsPresContext::AppUnitsToIntCSSPixels(frameRect.height)); + message.AppendInt(nsPresContext::AppUnitsToIntCSSPixels(frameSize.height)); message.AppendLiteral(") is bigger than the viewport ("); message.AppendInt(nsPresContext::AppUnitsToIntCSSPixels(refSize.width)); message.AppendLiteral(", ");