diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-11-01 14:29:51 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-04 20:29:07 +0100 |
commit | 1d07c724317126c03ddadaed8cda2a0fcf783073 (patch) | |
tree | 56910e6f3398317c97d380007a2b1b2b4f7e608d | |
parent | c87b27f308eecb2beadc227e107b2df161b3466b (diff) |
Fix major performance regression in QGLWidget on texture bind
Since Qt 5.1 we have not recognized the GL_EXT_bgra extension on desktop
OpenGL, or the GL_EXT_texture_format_BGRA8888 extension on OpenGL ES.
This patch matches the GL_EXT_bgra extension on both OpenGL and OpenGL ES
and adds discovery of GL_EXT_texture_format_BGRA8888 under OpenGL ES.
The old name for GL_EXT_texture_format_BGRA8888, GL_IMG_texture_format_BGRA8888
is also recognized.
Change-Id: I2035bfe045aee14e86a1f407f5b8556454f8bb90
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
-rw-r--r-- | src/gui/opengl/qopenglfunctions.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index a4ed74637c..0e5a1327b0 100644 --- a/src/gui/opengl/qopenglfunctions.cpp +++ b/src/gui/opengl/qopenglfunctions.cpp @@ -347,6 +347,9 @@ static int qt_gl_resolve_extensions() { int extensions = 0; QOpenGLExtensionMatcher extensionMatcher; + if (extensionMatcher.match("GL_EXT_bgra")) + extensions |= QOpenGLExtensions::BGRATextureFormat; + #if defined(QT_OPENGL_ES) if (extensionMatcher.match("GL_OES_mapbuffer")) extensions |= QOpenGLExtensions::MapBuffer; @@ -356,10 +359,9 @@ static int qt_gl_resolve_extensions() extensions |= QOpenGLExtensions::ElementIndexUint; if (extensionMatcher.match("GL_OES_depth24")) extensions |= QOpenGLExtensions::Depth24; - - if (extensionMatcher.match("GL_EXT_bgra")) + // TODO: Consider matching GL_APPLE_texture_format_BGRA8888 as well, but it needs testing. + if (extensionMatcher.match("GL_IMG_texture_format_BGRA8888") || extensionMatcher.match("GL_EXT_texture_format_BGRA8888")) extensions |= QOpenGLExtensions::BGRATextureFormat; - #else QSurfaceFormat format = QOpenGLContext::currentContext()->format(); extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer; |