Bug 1341987 - Part 2: Drop cascade level from last refresh time for transform. r=birtles
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 27 Feb 2017 11:30:56 +0900
changeset 393971 b2d04e22fa338410f1eb3922e58458922f647562
parent 393970 6a83f222b4204f3b94fc9b789f2bb1765270b991
child 393972 81cfa489cb872e065067eefcad1a60487bb7d5a3
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1341987
milestone54.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 1341987 - Part 2: Drop cascade level from last refresh time for transform. r=birtles We no longer need separate time for cascade levels respectively since we do send all type of animations on the same element to the compositor regardless of cascade level. MozReview-Commit-ID: 7cGQGE3yHvm
dom/animation/EffectCompositor.cpp
dom/animation/EffectSet.h
dom/animation/KeyframeEffectReadOnly.cpp
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -489,17 +489,17 @@ EffectCompositor::GetServoAnimationRule(
   for (KeyframeEffectReadOnly* effect : sortedEffectList) {
     effect->GetAnimation()->ComposeStyle(animRule, propertiesToSkip);
   }
 
   MOZ_ASSERT(effectSet == EffectSet::GetEffectSet(aElement, aPseudoType),
              "EffectSet should not change while composing style");
 
   effectSet->UpdateLastTransformSyncTime(
-    aCascadeLevel, mPresContext->RefreshDriver()->MostRecentRefresh());
+    mPresContext->RefreshDriver()->MostRecentRefresh());
   return animRule.mServo;
 }
 
 void
 EffectCompositor::ClearElementsToRestyle()
 {
   MOZ_ASSERT(NS_IsMainThread());
   const auto iterEnd = mElementsToRestyle.end();
@@ -760,17 +760,17 @@ EffectCompositor::ComposeAnimationRule(d
     : effects->PropertiesForAnimationsLevel();
   for (KeyframeEffectReadOnly* effect : sortedEffectList) {
     effect->GetAnimation()->ComposeStyle(animRule, propertiesToSkip);
   }
 
   MOZ_ASSERT(effects == EffectSet::GetEffectSet(aElement, aPseudoType),
              "EffectSet should not change while composing style");
 
-  effects->UpdateLastTransformSyncTime(aCascadeLevel, aRefreshTime);
+  effects->UpdateLastTransformSyncTime(aRefreshTime);
 }
 
 /* static */ void
 EffectCompositor::GetOverriddenProperties(nsStyleContext* aStyleContext,
                                           EffectSet& aEffectSet,
                                           nsCSSPropertyIDSet&
                                             aPropertiesOverridden)
 {
--- a/dom/animation/EffectSet.h
+++ b/dom/animation/EffectSet.h
@@ -164,26 +164,23 @@ public:
   size_t Count() const { return mEffects.Count(); }
 
   struct AnimationRule&
   AnimationRule(EffectCompositor::CascadeLevel aCascadeLevel)
   {
     return mAnimationRule[aCascadeLevel];
   }
 
-  const TimeStamp& LastTransformSyncTime(EffectCompositor::CascadeLevel
-                                           aCascadeLevel) const
+  const TimeStamp& LastTransformSyncTime() const
   {
-    return mLastTransformSyncTime[aCascadeLevel];
+    return mLastTransformSyncTime;
   }
-  void UpdateLastTransformSyncTime(EffectCompositor::CascadeLevel
-                                     aCascadeLevel,
-                                   const TimeStamp& aRefreshTime)
+  void UpdateLastTransformSyncTime(const TimeStamp& aRefreshTime)
   {
-    mLastTransformSyncTime[aCascadeLevel] = aRefreshTime;
+    mLastTransformSyncTime = aRefreshTime;
   }
 
   bool CascadeNeedsUpdate() const { return mCascadeNeedsUpdate; }
   void MarkCascadeNeedsUpdate() { mCascadeNeedsUpdate = true; }
   void MarkCascadeUpdated() { mCascadeNeedsUpdate = false; }
 
   void UpdateAnimationGeneration(nsPresContext* aPresContext);
   uint64_t GetAnimationGeneration() const { return mAnimationGeneration; }
@@ -213,20 +210,17 @@ private:
                   EffectCompositor::CascadeLevel(
                     EffectCompositor::kCascadeLevelCount),
                   mozilla::AnimationRule> mAnimationRule;
 
   // Refresh driver timestamp from the moment when transform animations in this
   // effect set were last updated and sent to the compositor. This is used for
   // transform animations that run on the compositor but need to be updated on
   // the main thread periodically (e.g. so scrollbars can be updated).
-  EnumeratedArray<EffectCompositor::CascadeLevel,
-                  EffectCompositor::CascadeLevel(
-                    EffectCompositor::kCascadeLevelCount),
-                  TimeStamp> mLastTransformSyncTime;
+  TimeStamp mLastTransformSyncTime;
 
   // Dirty flag to represent when the mPropertiesWithImportantRules and
   // mPropertiesForAnimationsLevel on effects in this set might need to be
   // updated.
   //
   // Set to true any time the set of effects is changed or when
   // one the effects goes in or out of the "in effect" state.
   bool mCascadeNeedsUpdate;
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -1369,18 +1369,17 @@ KeyframeEffectReadOnly::CanThrottleTrans
     presContext->RefreshDriver()->MostRecentRefresh();
 
   EffectSet* effectSet = EffectSet::GetEffectSet(mTarget->mElement,
                                                  mTarget->mPseudoType);
   MOZ_ASSERT(effectSet, "CanThrottleTransformChanges is expected to be called"
                         " on an effect in an effect set");
   MOZ_ASSERT(mAnimation, "CanThrottleTransformChanges is expected to be called"
                          " on an effect with a parent animation");
-  TimeStamp lastSyncTime =
-    effectSet->LastTransformSyncTime(mAnimation->CascadeLevel());
+  TimeStamp lastSyncTime = effectSet->LastTransformSyncTime();
   // If this animation can cause overflow, we can throttle some of the ticks.
   if (!lastSyncTime.IsNull() &&
       (now - lastSyncTime) < OverflowRegionRefreshInterval()) {
     return true;
   }
 
   // If the nearest scrollable ancestor has overflow:hidden,
   // we don't care about overflow.