Bug 1363830 - use previous frame time when advancing animations, r=kats

MozReview-Commit-ID: CqKOguZXnF9

--HG--
extra : rebase_source : b1ba85d20978fe5e7853a07065df7e3626c4a482
This commit is contained in:
peter chang 2017-06-29 13:44:00 -07:00
parent 4b9801e41b
commit 84df6e8c7e
2 changed files with 11 additions and 1 deletions

View File

@ -1053,7 +1053,16 @@ WebRenderBridgeParent::AdvanceAnimations()
if (CompositorBridgeParent* cbp = GetRootCompositorBridgeParent()) {
animTime = cbp->GetTestingTimeStamp().valueOr(animTime);
}
AnimationHelper::SampleAnimations(mAnimStorage, animTime);
AnimationHelper::SampleAnimations(mAnimStorage,
!mPreviousFrameTimeStamp.IsNull() ?
mPreviousFrameTimeStamp : 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();
}
void

View File

@ -281,6 +281,7 @@ private:
nsDataHashtable<nsUint64HashKey, RefPtr<WebRenderImageHost>> mExternalImageIds;
nsTArray<ImageCompositeNotificationInfo> mImageCompositeNotifications;
TimeStamp mPreviousFrameTimeStamp;
// These fields keep track of the latest layer observer epoch values in the child and the
// parent. mChildLayerObserverEpoch is the latest epoch value received from the child.
// mParentLayerObserverEpoch is the latest epoch value that we have told TabParent about