diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-01-20 04:01:26 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-01-20 04:01:26 (GMT) |
commit | 63fe6b6d3ff66067b8309c6111c49c6a41620e55 (patch) | |
tree | fe296fea28c0604eb07a2bc81248973c656a08b6 /src/opengl/qpixmapdata_gl.cpp | |
parent | 3700ecf4236233fe73afbde671cfdc8e194a0125 (diff) | |
parent | f95956a6cc61d0c05d96e2f8027167f51ed7dbea (diff) | |
download | Qt-63fe6b6d3ff66067b8309c6111c49c6a41620e55.zip Qt-63fe6b6d3ff66067b8309c6111c49c6a41620e55.tar.gz Qt-63fe6b6d3ff66067b8309c6111c49c6a41620e55.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/opengl/qpixmapdata_gl.cpp')
-rw-r--r-- | src/opengl/qpixmapdata_gl.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 1bfb6e3..6d47687 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -252,6 +252,10 @@ QGLPixmapData::QGLPixmapData(PixelType type) { setSerialNumber(++qt_gl_pixmap_serial); m_glDevice.setPixmapData(this); + + // Set InteralBindOptions minus the memory managed, since this + // QGLTexture is not managed as part of the internal texture cache + m_texture.options = QGLContext::PremultipliedAlphaBindOption; } QGLPixmapData::~QGLPixmapData() @@ -340,18 +344,18 @@ void QGLPixmapData::ensureCreated() const } if (!m_source.isNull()) { + glBindTexture(target, m_texture.id); if (external_format == GL_RGB) { const QImage tx = m_source.convertToFormat(QImage::Format_RGB888); - - glBindTexture(target, m_texture.id); glTexSubImage2D(target, 0, 0, 0, w, h, external_format, GL_UNSIGNED_BYTE, tx.bits()); } else { const QImage tx = ctx->d_func()->convertToGLFormat(m_source, true, external_format); - - glBindTexture(target, m_texture.id); glTexSubImage2D(target, 0, 0, 0, w, h, external_format, GL_UNSIGNED_BYTE, tx.bits()); + // convertToGLFormat will flip the Y axis, so it needs to + // be drawn upside down + m_texture.options |= QGLContext::InvertedYBindOption; } if (useFramebufferObjects()) |