Bug 1181392 part 2 - Remove use of IsFinishedTransition from Animation::ComposeStyle; r=dbaron
authorBrian Birtles <birtles@gmail.com>
Fri, 07 Aug 2015 12:29:35 +0900
changeset 288398 4e8a8884e36ff65a91e732c0f5ed17dc823e565b
parent 288397 7fa8a6d1f67f9e3ab960de0b539100169e926727
child 288399 bcf2c0c393cf0642f7a100c3e4e7d6b0b6b748f5
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1181392
milestone42.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 1181392 part 2 - Remove use of IsFinishedTransition from Animation::ComposeStyle; r=dbaron Animation::ComposeStyle uses IsFinishedTransition to skip doing work for transitions that have run their course. We can, however, generalize this to cover all animations that are not currently contributing to the animated style--that is animations that are not "in effect". We need to add this check *after* we update aNeedsRefreshes since an animation that is not "in effect" because it has a delay and no backwards fill (in this case it will have a play state of "running") still needs refreshes.
dom/animation/Animation.cpp
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -549,26 +549,30 @@ Animation::CanThrottle() const
   return mIsRunningOnCompositor;
 }
 
 void
 Animation::ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
                         nsCSSPropertySet& aSetProperties,
                         bool& aNeedsRefreshes)
 {
-  if (!mEffect || mEffect->IsFinishedTransition()) {
+  if (!mEffect) {
     return;
   }
 
   AnimationPlayState playState = PlayState();
   if (playState == AnimationPlayState::Running ||
       playState == AnimationPlayState::Pending) {
     aNeedsRefreshes = true;
   }
 
+  if (!IsInEffect()) {
+    return;
+  }
+
   // In order to prevent flicker, there are a few cases where we want to use
   // a different time for rendering that would otherwise be returned by
   // GetCurrentTime. These are:
   //
   // (a) For animations that are pausing but which are still running on the
   //     compositor. In this case we send a layer transaction that removes the
   //     animation but which also contains the animation values calculated on
   //     the main thread. To prevent flicker when this occurs we want to ensure