diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-12-08 14:18:03 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-12-08 14:18:03 (GMT) |
commit | 5146c3cb984fe6bfc661811559515b9e84d14628 (patch) | |
tree | 2cf7146bfa9dd816ec6f0c0c9217fb078282d863 /src/opengl | |
parent | 1de8a5bc428a53158028f5a71319d88538c19c54 (diff) | |
parent | c8ab564be91deb72e4d3ab0d9ea46ad2ce608d90 (diff) | |
download | Qt-5146c3cb984fe6bfc661811559515b9e84d14628.zip Qt-5146c3cb984fe6bfc661811559515b9e84d14628.tar.gz Qt-5146c3cb984fe6bfc661811559515b9e84d14628.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qgl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 1ff102f..967ba48 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2234,6 +2234,14 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G } } } +#ifdef QT_OPENGL_ES + // OpenGL/ES requires that the internal and external formats be identical. + // This is typically used to convert GL_RGBA into GL_BGRA. + // Also, we need to use GL_UNSIGNED_BYTE when the format is GL_BGRA. + internalFormat = externalFormat; + if (pixel_type == GL_UNSIGNED_INT_8_8_8_8_REV) + pixel_type = GL_UNSIGNED_BYTE; +#endif #ifdef QGL_BIND_TEXTURE_DEBUG printf(" - uploading, image.format=%d, externalFormat=0x%x, internalFormat=0x%x, pixel_type=0x%x\n", img.format(), externalFormat, internalFormat, pixel_type); |