예제 #1
0
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);
}
예제 #2
0
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();
    }
}