Bug 1321412 - Feed the return value of ShouldPrerenderTransformedContent() directly into nsDisplayTransform::mAllowAsyncAnimation. r=mattwoodrow
MozReview-Commit-ID: L00D3h5PhTF
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2200,21 +2200,23 @@ nsIFrame::BuildDisplayListForStackingCon
bool hasPerspective = HasPerspective();
// reset blend mode so we can keep track if this stacking context needs have
// a nsDisplayBlendContainer. Set the blend mode back when the routine exits
// so we keep track if the parent stacking context needs a container too.
AutoSaveRestoreContainsBlendMode autoRestoreBlendMode(*aBuilder);
aBuilder->SetContainsBlendMode(false);
nsRect dirtyRectOutsideTransform = dirtyRect;
+ bool allowAsyncAnimation = false;
if (isTransformed) {
const nsRect overflow = GetVisualOverflowRectRelativeToSelf();
if (nsDisplayTransform::ShouldPrerenderTransformedContent(aBuilder,
this)) {
dirtyRect = overflow;
+ allowAsyncAnimation = true;
} else {
if (overflow.IsEmpty() && !extend3DContext) {
return;
}
// If we're in preserve-3d then grab the dirty rect that was given to the root
// and transform using the combined transform.
if (Combines3DTransformWithAncestors()) {
@@ -2566,22 +2568,20 @@ nsIFrame::BuildDisplayListForStackingCon
outerReferenceFrame =
aBuilder->FindReferenceFrameFor(GetParent(), &toOuterReferenceFrame);
}
buildingDisplayList.SetReferenceFrameAndCurrentOffset(outerReferenceFrame,
GetOffsetToCrossDoc(outerReferenceFrame));
if (!aBuilder->IsForGenerateGlyphMask() &&
!aBuilder->IsForPaintingSelectionBG()) {
- bool isFullyVisible =
- dirtyRectOutsideSVGEffects.Contains(GetVisualOverflowRectRelativeToSelf());
nsDisplayTransform *transformItem =
new (aBuilder) nsDisplayTransform(aBuilder, this,
&resultList, dirtyRect, 0,
- isFullyVisible);
+ allowAsyncAnimation);
resultList.AppendNewToTop(transformItem);
}
if (hasPerspective) {
if (clipCapturedBy == ContainerItemType::ePerspective) {
clipState.ExitStackingContextContents(&containerItemScrollClip);
}
resultList.AppendNewToTop(