Bug 1435022 - Clean up GetLastComposeTime. r?sotaro
MozReview-Commit-ID: CEaz01FyjSs
--- a/gfx/layers/ipc/CompositorVsyncScheduler.cpp
+++ b/gfx/layers/ipc/CompositorVsyncScheduler.cpp
@@ -329,10 +329,17 @@ CompositorVsyncScheduler::DispatchVREven
void
CompositorVsyncScheduler::ScheduleTask(already_AddRefed<CancelableRunnable> aTask)
{
MOZ_ASSERT(CompositorThreadHolder::Loop());
CompositorThreadHolder::Loop()->PostDelayedTask(Move(aTask), 0);
}
+const TimeStamp&
+CompositorVsyncScheduler::GetLastComposeTime() const
+{
+ MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
+ return mLastCompose;
+}
+
} // namespace layers
} // namespace mozilla
--- a/gfx/layers/ipc/CompositorVsyncScheduler.h
+++ b/gfx/layers/ipc/CompositorVsyncScheduler.h
@@ -78,21 +78,21 @@ public:
bool NeedsComposite();
/**
* Force a composite to happen right away, without waiting for the next vsync.
* This must be called on the compositor thread.
*/
void ForceComposeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect);
- const TimeStamp& GetLastComposeTime()
- {
- return mLastCompose;
- }
-
+ /**
+ * Return the vsync timestamp of the last or ongoing composite. Must be called
+ * on the compositor thread.
+ */
+ const TimeStamp& GetLastComposeTime() const;
#ifdef COMPOSITOR_PERFORMANCE_WARNING
const TimeStamp& GetExpectedComposeStartTime()
{
return mExpectedComposeStartTime;
}
#endif
private: