From 108ab335537d20bc74aa9115d46cf91243223c4e Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 4 Dec 2009 17:03:41 +1000 Subject: Better check for EGL extension strings The previous code might have failed if the desired extension name was a prefix of another name: "EGL_foo" member of "EGL_foo_bar". This change introduces a more precise check. Task-number: QTBUG-6454 Reviewed-by: Sarah Smith --- src/gui/egl/qegl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp index cf28dc4..6ee4bfc 100644 --- a/src/gui/egl/qegl.cpp +++ b/src/gui/egl/qegl.cpp @@ -429,7 +429,10 @@ QString QEglContext::extensions() bool QEglContext::hasExtension(const char* extensionName) { - return extensions().contains(QLatin1String(extensionName)); + QList extensions = + QByteArray(reinterpret_cast + (eglQueryString(QEglContext::defaultDisplay(0), EGL_EXTENSIONS))).split(' '); + return extensions.contains(extensionName); } QEglContext *QEglContext::currentContext(QEgl::API api) -- cgit v0.12