author | Hiroyuki Ikezoe <hikezoe@mozilla.com> |
Mon, 23 Apr 2018 06:27:19 +0900 | |
changeset 468540 | 8f6ffc8378e3db276bcf3f0321f3a1699b34bc26 |
parent 468539 | ad24bc2a835edeb7fdeb55f61721143d96196859 |
child 468541 | 49884f49386918a23b65867594b59ab90e33ca91 |
push id | 9165 |
push user | asasaki@mozilla.com |
push date | Thu, 26 Apr 2018 21:04:54 +0000 |
treeherder | mozilla-beta@064c3804de2e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | kats |
bugs | 1455841 |
milestone | 61.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
|
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp +++ b/gfx/layers/wr/WebRenderBridgeParent.cpp @@ -1160,34 +1160,42 @@ void WebRenderBridgeParent::ActorDestroy(ActorDestroyReason aWhy) { Destroy(); } void WebRenderBridgeParent::AdvanceAnimations() { - Maybe<TimeStamp> testingTimeStamp; if (CompositorBridgeParent* cbp = GetRootCompositorBridgeParent()) { - testingTimeStamp = cbp->GetTestingTimeStamp(); + Maybe<TimeStamp> testingTimeStamp = cbp->GetTestingTimeStamp(); + if (testingTimeStamp) { + // If we are on testing refresh mode, use the testing time stamp. And + // also we don't update mPreviousFrameTimeStamp since unlike normal + // refresh mode, on the testing mode animations on the compositor are + // synchronously composed, so we don't need to worry about the time gap + // between the main thread and compositor thread. + AnimationHelper::SampleAnimations(mAnimStorage, *testingTimeStamp); + return; + } } - TimeStamp animTime = testingTimeStamp.valueOr( - !mPreviousFrameTimeStamp.IsNull() - ? mPreviousFrameTimeStamp - : mCompositorScheduler->GetLastComposeTime()); - - - AnimationHelper::SampleAnimations(mAnimStorage, animTime); + TimeStamp lastComposeTime = mCompositorScheduler->GetLastComposeTime(); + // if we have already mPreviousTimeStamp, use it since on the compositor the + // time in the previous tick is more closer to the main-thread tick time. + AnimationHelper::SampleAnimations(mAnimStorage, + !mPreviousFrameTimeStamp.IsNull() + ? mPreviousFrameTimeStamp + : lastComposeTime); // 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(); + mAnimStorage->AnimatedValueCount() ? lastComposeTime : TimeStamp(); } void WebRenderBridgeParent::SampleAnimations(nsTArray<wr::WrOpacityProperty>& aOpacityArray, nsTArray<wr::WrTransformProperty>& aTransformArray) { AdvanceAnimations();