summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-12-04 07:03:41 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-12-04 07:03:41 (GMT)
commit108ab335537d20bc74aa9115d46cf91243223c4e (patch)
tree0b8d68c1dd1bd041768f77acb2174492ff22113e /src
parent0ced23b6af63c42b04977faf94deb3ff0a57ff4e (diff)
downloadQt-108ab335537d20bc74aa9115d46cf91243223c4e.zip
Qt-108ab335537d20bc74aa9115d46cf91243223c4e.tar.gz
Qt-108ab335537d20bc74aa9115d46cf91243223c4e.tar.bz2
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
Diffstat (limited to 'src')
-rw-r--r--src/gui/egl/qegl.cpp5
1 files changed, 4 insertions, 1 deletions
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<QByteArray> extensions =
+ QByteArray(reinterpret_cast<const char *>
+ (eglQueryString(QEglContext::defaultDisplay(0), EGL_EXTENSIONS))).split(' ');
+ return extensions.contains(extensionName);
}
QEglContext *QEglContext::currentContext(QEgl::API api)