Remove Q_ASSERT when getting the OpenGL Context Profile
authorAndy Nichols <andy.nichols@digia.com>
Mon, 1 Sep 2014 10:45:10 +0000 (12:45 +0200)
committerAndy Nichols <andy.nichols@digia.com>
Mon, 1 Sep 2014 10:51:45 +0000 (12:51 +0200)
We do not actually use the OpenGL context in this method other than to
query the profile type if one is available.  In the case that there is
no context the profile type does not matter and the default value of
QSurfaceFormat::NoProfile is correct.

Change-Id: Ice4440fe0e578d4cdcba347f5325768667722af8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/quick/scenegraph/util/qsgshadersourcebuilder.cpp

index 824b790..ebfe86e 100644 (file)
@@ -387,8 +387,8 @@ QSurfaceFormat::OpenGLContextProfile QSGShaderSourceBuilder::contextProfile() co
 {
     QOpenGLContext *context = QOpenGLContext::currentContext();
     QSurfaceFormat::OpenGLContextProfile profile = QSurfaceFormat::NoProfile;
-    Q_ASSERT(context);
-    profile = context->format().profile();
+    if (context)
+        profile = context->format().profile();
     return profile;
 }