예제 #1
0
bool DisplayRefreshMonitorMac::requestRefreshCallback()
{
    if (!isActive())
        return false;

    if (!m_displayLink) {
        setIsActive(false);
        CVReturn error = CVDisplayLinkCreateWithCGDisplay(displayID(), &m_displayLink);
        if (error)
            return false;

        error = CVDisplayLinkSetOutputCallback(m_displayLink, displayLinkCallback, this);
        if (error)
            return false;

        error = CVDisplayLinkStart(m_displayLink);
        if (error)
            return false;

        setIsActive(true);
    }

    LockHolder lock(mutex());
    setIsScheduled(true);
    return true;
}
예제 #2
0
bool ThreadedCompositor::DisplayRefreshMonitor::requestRefreshCallback()
{
    LockHolder locker(mutex());
    setIsScheduled(true);
    return true;
}