From fd14dd1542a965af6cd307ab4b3f20a2667beed3 Mon Sep 17 00:00:00 2001 From: Mason Chang Date: Fri, 5 Jun 2015 15:58:40 -0700 Subject: [PATCH] Bug 1171156. Add logging to OS X vsync timestamps. r=mstange --- gfx/thebes/gfxPlatformMac.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gfx/thebes/gfxPlatformMac.cpp b/gfx/thebes/gfxPlatformMac.cpp index 332255b253e..cde0459ef6a 100644 --- a/gfx/thebes/gfxPlatformMac.cpp +++ b/gfx/thebes/gfxPlatformMac.cpp @@ -577,7 +577,12 @@ static CVReturn VsyncCallback(CVDisplayLinkRef aDisplayLink, mozilla::TimeStamp previousVsync = display->mPreviousTimestamp; display->mPreviousTimestamp = nextVsync; mozilla::TimeStamp now = TimeStamp::Now(); - MOZ_ASSERT(nextVsync > previousVsync); + if (nextVsync <= previousVsync) { + TimeDuration next = nextVsync - now; + TimeDuration prev = now - previousVsync; + printf_stderr("Next from now: %f, prev from now: %f\n", next.ToMilliseconds(), prev.ToMilliseconds()); + MOZ_ASSERT(false, "Next vsync less than previous vsync\n"); + } // Bug 1158321 - The VsyncCallback can sometimes execute before the reported // vsync time. In those cases, normalize the timestamp to Now() as sending