Bug 1028216 - Backout 660cc013d558 (bug 952721) for causing b2g animation regressions.

This commit is contained in:
Matt Woodrow 2014-06-24 12:12:52 +12:00
Родитель 5f0227f1b9
Коммит 0f74b2d77a
1 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -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) {
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(", ");