diff options
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultrendercontext.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultrendercontext.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgdefaultrendercontext.cpp b/src/quick/scenegraph/qsgdefaultrendercontext.cpp index 92e7f983a0..6f10611ba3 100644 --- a/src/quick/scenegraph/qsgdefaultrendercontext.cpp +++ b/src/quick/scenegraph/qsgdefaultrendercontext.cpp @@ -70,6 +70,9 @@ QSGDefaultRenderContext::QSGDefaultRenderContext(QSGContext *context) */ void QSGDefaultRenderContext::initialize(void *context) { + if (!m_sg) + return; + QOpenGLContext *openglContext = static_cast<QOpenGLContext *>(context); QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions(); @@ -163,7 +166,9 @@ void QSGDefaultRenderContext::invalidate() m_gl->setProperty(QSG_RENDERCONTEXT_PROPERTY, QVariant()); m_gl = 0; - QSGRenderContext::invalidate(); + if (m_sg) + m_sg->renderContextInvalidated(this); + emit invalidated(); } static QBasicMutex qsg_framerender_mutex; @@ -273,7 +278,7 @@ void QSGDefaultRenderContext::initializeShader(QSGMaterialShader *shader) shader->initialize(); } -void QSGDefaultRenderContext::setAttachToGLContext(bool attach) +void QSGDefaultRenderContext::setAttachToGraphicsContext(bool attach) { Q_ASSERT(!isValid()); m_attachToGLContext = attach; |