Bug 1458798 - Clear the previous timestamp when we skip calling SampleAnimations in CompositeToTarget(). r?kats
The purpose of the previous timestamp is to reduce the time difference between
the timestamps on the main-thread and the compositor. Once we skipped a frame
to compose animations on the compositor, the timestamp is far behind from the
timestamp on the main-thread, so we should clear it.
MozReview-Commit-ID: EGiQfwejfsy
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -1272,39 +1272,42 @@ WebRenderBridgeParent::CompositeToTarget
// The two arguments are part of the CompositorVsyncSchedulerOwner API but in
// this implementation they should never be non-null.
MOZ_ASSERT(aTarget == nullptr);
MOZ_ASSERT(aRect == nullptr);
AUTO_PROFILER_TRACING("Paint", "CompositeToTraget");
if (mPaused || !mReceivedDisplayList) {
+ mPreviousFrameTimeStamp = TimeStamp();
return;
}
if (!mForceRendering &&
wr::RenderThread::Get()->TooManyPendingFrames(mApi->GetId())) {
// Render thread is busy, try next time.
mCompositorScheduler->ScheduleComposition();
+ mPreviousFrameTimeStamp = TimeStamp();
return;
}
mAsyncImageManager->SetCompositionTime(TimeStamp::Now());
mAsyncImageManager->ApplyAsyncImages();
if (!mAsyncImageManager->GetCompositeUntilTime().IsNull()) {
// Trigger another CompositeToTarget() call because there might be another
// frame that we want to generate after this one.
// It will check if we actually want to generate the frame or not.
mCompositorScheduler->ScheduleComposition();
}
if (!mAsyncImageManager->GetAndResetWillGenerateFrame() &&
!mForceRendering) {
// Could skip generating frame now.
+ mPreviousFrameTimeStamp = TimeStamp();
return;
}
wr::TransactionBuilder txn;
nsTArray<wr::WrOpacityProperty> opacityArray;
nsTArray<wr::WrTransformProperty> transformArray;