Bug 1321412 - Feed the return value of ShouldPrerenderTransformedContent() directly into nsDisplayTransform::mAllowAsyncAnimation. r=mattwoodrow draft
authorBotond Ballo <botond@mozilla.com>
Wed, 23 Nov 2016 12:53:46 -0500
changeset 448051 9d834c4cd75ce120e743c49732a538decc05c1cf
parent 448050 870d018a761cf77a8ed0f698553774945ddce1c6
child 448052 1ecd8fd39a1d3bc74200dbe4f53dd78eda57987e
push id38244
push userbballo@mozilla.com
push dateFri, 09 Dec 2016 01:03:26 +0000
reviewersmattwoodrow
bugs1321412
milestone53.0a1
Bug 1321412 - Feed the return value of ShouldPrerenderTransformedContent() directly into nsDisplayTransform::mAllowAsyncAnimation. r=mattwoodrow MozReview-Commit-ID: L00D3h5PhTF
layout/generic/nsFrame.cpp
--- 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(