src/MovieNode.cpp
// Invoke this method when a QSharedPointer<Chain> gets added
// (or when the state for a given chain is somehow missing)
// It will create the new state asynchronously and add it when it is ready.
Invoke this method when a QSharedPointer gets added
(or when the state for a given chain is somehow missing)
It will create the new state asynchronously and add it when it is ready.
Invoke this method when a QSharedPointer gets added ( or when the state for a given chain is somehow missing ) It will create the new state asynchronously and add it when it is ready .
void MovieNodeOpenGLWorker::addNewState(QSharedPointer<Chain> c) {
    auto p = m_p.toStrongRef();
    if (p.isNull()) return; 
    QSharedPointer<QOpenGLShaderProgram> shader;
    {
        QMutexLocker locker(&p->m_stateLock);
        if (!p->m_chains.contains(c)) return;
        if (p->m_renderStates.contains(c)) return;
        shader = p->m_blitShader;
    }
    makeCurrent();
    auto state = QSharedPointer<MovieNodeRenderState>::create(shader);
    {
        QMutexLocker locker(&p->m_stateLock);
        if (!p->m_chains.contains(c)) return;
        if (p->m_renderStates.contains(c)) return;
        p->m_renderStates.insert(c, state);
    }
}
void MovieNodeOpenGLWorker :: addNewState ( QSharedPointer < Chain > c ) { auto p = m_p . toStrongRef ( ) ; if ( p . isNull ( ) ) return ; QSharedPointer < QOpenGLShaderProgram > shader ; { QMutexLocker locker ( & p -> m_stateLock ) ; if ( ! p -> m_chains . contains ( c ) ) return ; if ( p -> m_renderStates . contains ( c ) ) return ; shader = p -> m_blitShader ; } makeCurrent ( ) ; auto state = QSharedPointer < MovieNodeRenderState > :: create ( shader ) ; { QMutexLocker locker ( & p -> m_stateLock ) ; if ( ! p -> m_chains . contains ( c ) ) return ; if ( p -> m_renderStates . contains ( c ) ) return ; p -> m_renderStates . insert ( c , state ) ; } }
Invoke this method when a QSharedPointer<Chain> gets added
(or when the state for a given chain is somehow missing)
It will create the new state asynchronously and add it when it is ready.
Invoke this method when a QSharedPointer<Chain > gets added ( or when the state for a given chain is somehow missing ) It will create the new state asynchronously and add it when it is ready .
// MovieNode was deleted // Don't make states that we don't have to // Check that everything is still OK