diff --git a/gfx/layers/ipc/CompositorVsyncScheduler.cpp b/gfx/layers/ipc/CompositorVsyncScheduler.cpp index 6e956e55f0f6..c3bf8a240c41 100644 --- a/gfx/layers/ipc/CompositorVsyncScheduler.cpp +++ b/gfx/layers/ipc/CompositorVsyncScheduler.cpp @@ -334,5 +334,12 @@ CompositorVsyncScheduler::ScheduleTask(already_AddRefed aTas CompositorThreadHolder::Loop()->PostDelayedTask(Move(aTask), 0); } +const TimeStamp& +CompositorVsyncScheduler::GetLastComposeTime() const +{ + MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread()); + return mLastCompose; +} + } // namespace layers } // namespace mozilla diff --git a/gfx/layers/ipc/CompositorVsyncScheduler.h b/gfx/layers/ipc/CompositorVsyncScheduler.h index 79885e70a74e..266d9c81a3a4 100644 --- a/gfx/layers/ipc/CompositorVsyncScheduler.h +++ b/gfx/layers/ipc/CompositorVsyncScheduler.h @@ -83,11 +83,11 @@ public: */ 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() {