Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
4.6.0
-
None
-
108ab335537d20bc74aa9115d46cf91243223c4e
Description
The method QEglContext::hasExtension() does not parse the EGL extensions string correctly. The extension names are separated by spaces and may be substrings of one another, so that a simple substring search could yield a false positive depending on the platform and graphics driver.
This is essentially the same fix as the second patch attached to Qt bug #5732. This problem with parsing the extensions string is well-known and even prompted a change to the OpenGL API in OpenGL 3.0:
http://www.opengl.org/wiki/GlGetString#glGetString.28GL_EXTENSIONS.29
It would be better to share the utility function parse_extensions_string() among Qt components, but for know the patch is self-contained. Please forgive the use of C library functions instead of QString methods – I simply could not find a way to put the QString methods to reasonable use here without recreating nearly the same string scanning logic as with the C library functions.