Bug 1455315 - Use testing time stamp whenever we are on testing mode. r?kats draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 20 Apr 2018 13:27:27 +0900
changeset 785446 dbc91f3c5827ab3014be2899e4fe99d4675c506a
parent 785383 ea3555cf12afff38370e7a697db81f181e15dbf6
push id107233
push userhikezoe@mozilla.com
push dateFri, 20 Apr 2018 06:18:59 +0000
reviewerskats
bugs1455315
milestone61.0a1
Bug 1455315 - Use testing time stamp whenever we are on testing mode. r?kats MozReview-Commit-ID: 6IgsYt40KiX
gfx/layers/wr/WebRenderBridgeParent.cpp
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -1160,24 +1160,28 @@ void
 WebRenderBridgeParent::ActorDestroy(ActorDestroyReason aWhy)
 {
   Destroy();
 }
 
 void
 WebRenderBridgeParent::AdvanceAnimations()
 {
-  TimeStamp animTime = mCompositorScheduler->GetLastComposeTime();
+  Maybe<TimeStamp> testingTimeStamp;
   if (CompositorBridgeParent* cbp = GetRootCompositorBridgeParent()) {
-    animTime = cbp->GetTestingTimeStamp().valueOr(animTime);
+    testingTimeStamp = cbp->GetTestingTimeStamp();
   }
 
-  AnimationHelper::SampleAnimations(mAnimStorage,
-                                    !mPreviousFrameTimeStamp.IsNull() ?
-                                    mPreviousFrameTimeStamp : animTime);
+  TimeStamp animTime = testingTimeStamp.valueOr(
+    !mPreviousFrameTimeStamp.IsNull()
+    ? mPreviousFrameTimeStamp
+    : mCompositorScheduler->GetLastComposeTime());
+
+
+  AnimationHelper::SampleAnimations(mAnimStorage, animTime);
 
   // Reset the previous time stamp if we don't already have any running
   // animations to avoid using the time which is far behind for newly
   // started animations.
   mPreviousFrameTimeStamp =
     mAnimStorage->AnimatedValueCount() ? animTime : TimeStamp();
 }