From 1d07c724317126c03ddadaed8cda2a0fcf783073 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 1 Nov 2013 14:29:51 +0100 Subject: 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 --- src/gui/opengl/qopenglfunctions.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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; -- cgit v1.2.3