Use the current context to resolve extensions.
authorGunnar Sletta <gunnar.sletta@jollamobile.com>
Wed, 30 Jul 2014 14:31:36 +0000 (16:31 +0200)
committerGunnar Sletta <gunnar.sletta@jollamobile.com>
Thu, 31 Jul 2014 06:44:43 +0000 (08:44 +0200)
When updating the code to not use direct gl calls, this
code was changed to use the context's gl context. The
context doesn't have a context when the rendering happens
on the same thread as the scene graph rendering and
we get a crash.

Change-Id: I8adf62c0ed12bb055982a71ba59af76afeefcca1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
src/quick/items/context2d/qquickcontext2dtexture.cpp

index 19071ba..0ab76b0 100644 (file)
@@ -479,7 +479,7 @@ bool QQuickContext2DFBOTexture::doMultisampling() const
     static bool multisamplingSupported = false;
 
     if (!extensionsChecked) {
-        const QSet<QByteArray> extensions = m_context->glContext()->extensions();
+        const QSet<QByteArray> extensions = QOpenGLContext::currentContext()->extensions();
         multisamplingSupported = extensions.contains(QByteArrayLiteral("GL_EXT_framebuffer_multisample"))
             && extensions.contains(QByteArrayLiteral("GL_EXT_framebuffer_blit"));
         extensionsChecked = true;