summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_gl.cpp
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2010-01-20 16:48:45 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2010-01-20 16:48:45 (GMT)
commited760b619ed0748d1428b9f08b785913883b560c (patch)
tree1afc57deb86fa711c54ce53c987d7f612a6f7574 /src/opengl/qpixmapdata_gl.cpp
parentc3637e53cb4e4d64a60664874f15292982acbdbd (diff)
parent304c70a03406eb16b9a08719769655b75bf6d8e3 (diff)
downloadQt-ed760b619ed0748d1428b9f08b785913883b560c.zip
Qt-ed760b619ed0748d1428b9f08b785913883b560c.tar.gz
Qt-ed760b619ed0748d1428b9f08b785913883b560c.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'src/opengl/qpixmapdata_gl.cpp')
-rw-r--r--src/opengl/qpixmapdata_gl.cpp12
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())