Bug 1504929 - Break RestyleManager::GetAnimationGenerationForFrame into EffectSet::GetEffect and EffectSet::GetAnimationGeneration in AddAnimationsForProperty. r=birtles,sotaro
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 13 Nov 2018 10:18:23 +0000
changeset 446020 de569bb95b1c7ccb1abb0be686800a5ba3a789b2
parent 446019 b59d17710f5cc00763a8ef1c3b550b09aa264e51
child 446021 c84f0ad36ce92d46fcde4fdcb83dcb42af9745fe
push id109819
push usernerli@mozilla.com
push dateTue, 13 Nov 2018 16:35:04 +0000
treeherdermozilla-inbound@b0cacbf71b3d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles, sotaro
bugs1504929
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1504929 - Break RestyleManager::GetAnimationGenerationForFrame into EffectSet::GetEffect and EffectSet::GetAnimationGeneration in AddAnimationsForProperty. r=birtles,sotaro Since we use the EffectSet later in the same function. Depends on D11599 Differential Revision: https://phabricator.services.mozilla.com/D11601
layout/painting/nsDisplayList.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -593,20 +593,21 @@ AddAnimationsForProperty(nsIFrame* aFram
     return;
   }
 
   // Update the animation generation on the layer. We need to do this before
   // any early returns since even if we don't add any animations to the
   // layer, we still need to mark it as up-to-date with regards to animations.
   // Otherwise, in RestyleManager we'll notice the discrepancy between the
   // animation generation numbers and update the layer indefinitely.
+  // Note that EffectSet::GetEffectSet expects to work with the style frame
+  // instead of the primary frame.
+  EffectSet* effects = EffectSet::GetEffectSet(styleFrame);
   uint64_t animationGeneration =
-    // Note that GetAnimationGenerationForFrame() calles EffectSet::GetEffectSet
-    // that expects to work with the style frame instead of the primary frame.
-    RestyleManager::GetAnimationGenerationForFrame(styleFrame);
+    effects ? effects->GetAnimationGeneration() : 0;
   aAnimationInfo.SetAnimationGeneration(animationGeneration);
 
   EffectCompositor::ClearIsRunningOnCompositor(styleFrame, aProperty);
   nsTArray<RefPtr<dom::Animation>> compositorAnimations =
     EffectCompositor::GetAnimationsForCompositor(styleFrame, aProperty);
   if (compositorAnimations.IsEmpty()) {
     return;
   }
@@ -669,17 +670,16 @@ AddAnimationsForProperty(nsIFrame* aFram
   } else if (aProperty == eCSSProperty_opacity) {
     data = null_t();
   }
 
   MOZ_ASSERT(
     nsCSSProps::PropHasFlags(aProperty, CSSPropFlags::CanAnimateOnCompositor),
     "inconsistent property flags");
 
-  EffectSet* effects = EffectSet::GetEffectSet(styleFrame);
   // Add from first to last (since last overrides)
   for (size_t animIdx = 0; animIdx < compositorAnimations.Length(); animIdx++) {
     dom::Animation* anim = compositorAnimations[animIdx];
     if (!anim->IsRelevant()) {
       continue;
     }
 
     dom::KeyframeEffect* keyframeEffect =