Skip to content

Commit

Permalink
Bug 1363830 - use previous frame time when advancing animations, r=kats
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: CqKOguZXnF9
  • Loading branch information
howareyou322 committed Jun 29, 2017
1 parent 6183c7c commit c66cbb8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gfx/layers/wr/WebRenderBridgeParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions gfx/layers/wr/WebRenderBridgeParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ class WebRenderBridgeParent final : public PWebRenderBridgeParent
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
Expand Down

0 comments on commit c66cbb8

Please sign in to comment.