Bug 1321412 - If the animated content is already fully rendered, enable async animation regardless of size. r=mattwoodrow

MozReview-Commit-ID: OePAkUqp2Q

--HG--
extra : rebase_source : af5869826b827c1482e97c97a4204597f2c95f47
This commit is contained in:
Botond Ballo 2016-12-08 19:44:19 -05:00
parent 2e3caa982c
commit 6579cf5fe9

View File

@ -6260,6 +6260,13 @@ nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBui
return NoPrerender;
}
// If the incoming dirty rect already contains the entire overflow area,
// we are already rendering the entire content.
nsRect overflow = aFrame->GetVisualOverflowRectRelativeToSelf();
if (aDirtyRect->Contains(overflow)) {
return FullPrerender;
}
float viewportRatioX = gfxPrefs::AnimationPrerenderViewportRatioLimitX();
float viewportRatioY = gfxPrefs::AnimationPrerenderViewportRatioLimitY();
uint32_t absoluteLimitX = gfxPrefs::AnimationPrerenderAbsoluteLimitX();
@ -6274,7 +6281,6 @@ nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBui
aFrame->PresContext()->DevPixelsToAppUnits(absoluteLimitY));
nsSize maxSize = Min(relativeLimit, absoluteLimit);
gfxSize scale = nsLayoutUtils::GetTransformToAncestorScale(aFrame);
nsRect overflow = aFrame->GetVisualOverflowRectRelativeToSelf();
nsSize frameSize = nsSize(overflow.Size().width * scale.width,
overflow.Size().height * scale.height);
if (frameSize <= maxSize) {