Bug 1435022 - Remove the ResumeComposition function from the vsync scheduler. r?sotaro draft
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 01 Feb 2018 16:28:50 -0500
changeset 750294 52539b143f316b945b16c5393b87a11d3b521b44
parent 750293 dc2cc3042acbb0a4d81df5c6c0325d5772e68e93
child 750295 7d2c8b917ad750e97fd5c97ce20e3da1c5c5a007
push id97612
push userkgupta@mozilla.com
push dateThu, 01 Feb 2018 21:30:35 +0000
reviewerssotaro
bugs1435022
milestone60.0a1
Bug 1435022 - Remove the ResumeComposition function from the vsync scheduler. r?sotaro Having a resume function without a corresponding pause function seems silly. And the implementation of the function is the same as doing a force-compose, which is what the call site is intending to do. So we can just remove this function and do a force-compose instead. MozReview-Commit-ID: LimMYQhAuEk
gfx/layers/ipc/CompositorBridgeParent.cpp
gfx/layers/ipc/CompositorVsyncScheduler.cpp
gfx/layers/ipc/CompositorVsyncScheduler.h
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -740,17 +740,17 @@ CompositorBridgeParent::ResumeCompositio
 #endif
     lock.NotifyAll();
     return;
   }
 
   mPaused = false;
 
   Invalidate();
-  mCompositorScheduler->ResumeComposition();
+  mCompositorScheduler->ForceComposeToTarget(nullptr, nullptr);
 
   // if anyone's waiting to make sure that composition really got resumed, tell them
   lock.NotifyAll();
 }
 
 void
 CompositorBridgeParent::ForceComposition()
 {
--- a/gfx/layers/ipc/CompositorVsyncScheduler.cpp
+++ b/gfx/layers/ipc/CompositorVsyncScheduler.cpp
@@ -363,24 +363,16 @@ CompositorVsyncScheduler::DispatchVREven
 void
 CompositorVsyncScheduler::ScheduleTask(already_AddRefed<CancelableRunnable> aTask)
 {
   MOZ_ASSERT(CompositorThreadHolder::Loop());
   CompositorThreadHolder::Loop()->PostDelayedTask(Move(aTask), 0);
 }
 
 void
-CompositorVsyncScheduler::ResumeComposition()
-{
-  MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
-  mLastCompose = TimeStamp::Now();
-  ComposeToTarget(nullptr);
-}
-
-void
 CompositorVsyncScheduler::ComposeToTarget(gfx::DrawTarget* aTarget, const IntRect* aRect)
 {
   MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
   MOZ_ASSERT(mVsyncSchedulerOwner);
   mVsyncSchedulerOwner->CompositeToTarget(aTarget, aRect);
 }
 
 } // namespace layers
--- a/gfx/layers/ipc/CompositorVsyncScheduler.h
+++ b/gfx/layers/ipc/CompositorVsyncScheduler.h
@@ -46,17 +46,16 @@ class CompositorVsyncScheduler
 
 public:
   explicit CompositorVsyncScheduler(CompositorVsyncSchedulerOwner* aVsyncSchedulerOwner,
                                     widget::CompositorWidget* aWidget);
 
   bool NotifyVsync(TimeStamp aVsyncTimestamp);
   void SetNeedsComposite();
 
-  void ResumeComposition();
   void ComposeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect = nullptr);
   void PostCompositeTask(TimeStamp aCompositeTimestamp);
   void PostVRTask(TimeStamp aTimestamp);
   void Destroy();
   void ScheduleComposition();
   void CancelCurrentCompositeTask();
   bool NeedsComposite();
   void Composite(TimeStamp aVsyncTimestamp);