diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-02-23 13:22:13 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-25 17:08:02 +0100 |
commit | 501bd0fa6709caff3d5425abc16fa8ef3f5c88af (patch) | |
tree | f15f6b7977a0af5006348736494e2029079e9232 /src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | |
parent | aaea23708a46259094a8203f73ee0650c362d85f (diff) |
Fix crashes and incorrect extension queries on GL3+
glGetString(GL_EXTENSIONS) is deprecated in OpenGL 3.0+.
This means that in core profiles on 3.2+ (or without the fwd
compatibility bit on 3.0/3.1), the call is not supported and may
return NULL. This causes a crash in at least one place where we
try to blindly strstr the result. The correct solution is to use
QOpenGLContext::extensions() and hasExtension() which is prepared
to handle GL3+.
Change-Id: I52fec7dcee001cdc0933af03f5eed4b7c822b2bb
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultglyphnode_p.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index ad0c9dad07..3267eeed83 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -206,7 +206,7 @@ void QSG24BitTextMaskShader::initialize() QSGTextMaskShader::initialize(); // 0.25 was found to be acceptable error margin by experimentation. On Mac, the gamma is 2.0, // but using sRGB looks okay. - if (strstr((const char *) glGetString(GL_EXTENSIONS), "GL_ARB_framebuffer_sRGB") + if (QOpenGLContext::currentContext()->hasExtension(QByteArrayLiteral("GL_ARB_framebuffer_sRGB")) && m_glyphFormat == QFontEngine::Format_A32 && qAbs(fontSmoothingGamma() - 2.2) < 0.25) { m_useSRGB = true; |