Bug 1458798 - Clear the previous timestamp when we skip calling SampleAnimations in CompositeToTarget(). r=kats
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 03 May 2018 15:57:19 +0900
changeset 416804 da163bfbc6c8a460d6b3c551456174153912f743
parent 416803 a46dfe2330ff8e301bcb02c5d3d353ff0f480c3f
child 416805 c07ba1f49f5e52fc62820c11a41e47edd042bced
push id63546
push userkgupta@mozilla.com
push dateThu, 03 May 2018 11:25:31 +0000
treeherderautoland@da163bfbc6c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1458798
milestone61.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
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
gfx/layers/wr/WebRenderBridgeParent.cpp
--- 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;