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
--- 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);