Bug 927349 part 21 - Factor out AnimationPlayer::UpdateSourceContent; r=jwatt
authorBrian Birtles <birtles@gmail.com>
Mon, 22 Dec 2014 09:35:42 +0900
changeset 220805 c7aaf7025e59c1f8fe5462139745be76fe928fba
parent 220804 73316b8d04a0f43bc168c74ec34da49fe6c7f61d
child 220806 155b9d4cb8cbb5fdf8e41f5e3ff8782858e04381
push id53192
push userbbirtles@mozilla.com
push dateMon, 22 Dec 2014 00:36:19 +0000
treeherdermozilla-inbound@c7aaf7025e59 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs927349
milestone37.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 927349 part 21 - Factor out AnimationPlayer::UpdateSourceContent; r=jwatt In the future we will want to specifically just update source content without necessarily triggering any other actions that might take place on a tick (like queuing events).
dom/animation/AnimationPlayer.cpp
dom/animation/AnimationPlayer.h
--- a/dom/animation/AnimationPlayer.cpp
+++ b/dom/animation/AnimationPlayer.cpp
@@ -128,19 +128,17 @@ AnimationPlayer::SetSource(Animation* aS
   if (mSource) {
     mSource->SetParentTime(GetCurrentTime());
   }
 }
 
 void
 AnimationPlayer::Tick()
 {
-  if (mSource) {
-    mSource->SetParentTime(GetCurrentTime());
-  }
+  UpdateSourceContent();
 }
 
 void
 AnimationPlayer::StartNow()
 {
   // Currently we only expect this method to be called when we are in the
   // middle of initiating/resuming playback so we should have an unresolved
   // start time to update and a fixed current time to seek to.
@@ -271,16 +269,24 @@ AnimationPlayer::DoPause()
   mIsRunningOnCompositor = false;
 
   // Bug 1109390 - check for null result here and go to pending state
   mHoldTime = GetCurrentTime();
   mStartTime.SetNull();
 }
 
 void
+AnimationPlayer::UpdateSourceContent()
+{
+  if (mSource) {
+    mSource->SetParentTime(GetCurrentTime());
+  }
+}
+
+void
 AnimationPlayer::FlushStyle() const
 {
   nsIDocument* doc = GetRenderedDocument();
   if (doc) {
     doc->FlushPendingNotifications(Flush_Style);
   }
 }
 
--- a/dom/animation/AnimationPlayer.h
+++ b/dom/animation/AnimationPlayer.h
@@ -126,16 +126,17 @@ public:
   void ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
                     nsCSSPropertySet& aSetProperties,
                     bool& aNeedsRefreshes);
 
 protected:
   void DoPlay();
   void DoPause();
 
+  void UpdateSourceContent();
   void FlushStyle() const;
   void PostUpdate();
   // Remove this player from the pending player tracker and resets mIsPending
   // as necessary. The caller is responsible for resolving or aborting the
   // mReady promise as necessary.
   void CancelPendingPlay();
   StickyTimeDuration SourceContentEnd() const;