diff options
author | aavit <qt-info@nokia.com> | 2010-03-19 14:16:13 (GMT) |
---|---|---|
committer | aavit <qt-info@nokia.com> | 2010-03-19 14:16:13 (GMT) |
commit | b7a0a8dced26daf895fa9932e5a8c81e59fd7b84 (patch) | |
tree | b942a39f3cdb37ecf5556a2e065853d6c77a81b8 /src | |
parent | ff66d8bb392db5e76409ecbe4e25785e896d950e (diff) | |
parent | d594799f1e31e7cf0de7d01a2afa2c8cc06c7fd4 (diff) | |
download | Qt-b7a0a8dced26daf895fa9932e5a8c81e59fd7b84.zip Qt-b7a0a8dced26daf895fa9932e5a8c81e59fd7b84.tar.gz Qt-b7a0a8dced26daf895fa9932e5a8c81e59fd7b84.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Diffstat (limited to 'src')
-rw-r--r-- | src/opengl/qgl.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 5908f14..7aba25a 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2453,8 +2453,15 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, } #endif - if (!texture) - texture = bindTexture(pixmap.toImage(), target, format, key, options); + if (!texture) { + QImage image = pixmap.toImage(); + // If the system depth is 16 and the pixmap doesn't have an alpha channel + // then we convert it to RGB16 in the hope that it gets uploaded as a 16 + // bit texture which is much faster to access than a 32-bit one. + if (pixmap.depth() == 16 && !image.hasAlphaChannel() ) + image = image.convertToFormat(QImage::Format_RGB16); + texture = bindTexture(image, target, format, key, options); + } // NOTE: bindTexture(const QImage&, GLenum, GLint, const qint64, bool) should never return null Q_ASSERT(texture); |