void DisplayRefreshMonitorMac::displayLinkFired(double nowSeconds, double outputTimeSeconds) { LockHolder lock(mutex()); if (!isPreviousFrameDone()) return; setIsPreviousFrameDone(false); double webKitMonotonicNow = monotonicallyIncreasingTime(); double timeUntilOutput = outputTimeSeconds - nowSeconds; // FIXME: Should this be using webKitMonotonicNow? setMonotonicAnimationStartTime(webKitMonotonicNow + timeUntilOutput); callOnMainThread(handleDisplayRefreshedNotificationOnMainThread, this); }
void ThreadedCompositor::DisplayRefreshMonitor::displayRefreshCallback() { bool shouldHandleDisplayRefreshNotification = false; { LockHolder locker(mutex()); shouldHandleDisplayRefreshNotification = isScheduled() && isPreviousFrameDone(); if (shouldHandleDisplayRefreshNotification) { setIsPreviousFrameDone(false); setMonotonicAnimationStartTime(monotonicallyIncreasingTime()); } } if (shouldHandleDisplayRefreshNotification) DisplayRefreshMonitor::handleDisplayRefreshedNotificationOnMainThread(this); if (m_compositor) { if (m_compositor->m_clientRendersNextFrame.compareExchangeStrong(true, false)) m_compositor->m_scene->renderNextFrame(); if (m_compositor->m_coordinateUpdateCompletionWithClient.compareExchangeStrong(true, false)) m_compositor->m_compositingRunLoop->updateCompleted(); } }