summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_gl.cpp
diff options
context:
space:
mode:
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())