aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/util/qsgpainternode.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-04-03 12:13:02 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-03 12:49:14 +0200
commit330dbc6bba11f401c9f258aa6281dbdfebfc8602 (patch)
tree4e440f9e7e89cbd3ea01fec9f4c787503a18f5f4 /src/quick/scenegraph/util/qsgpainternode.cpp
parent240a3cd360309c5d525b635e40b12697deca6c0e (diff)
Properly swizzle texture data before upload in QQuickPaintedItem.
We already did this properly in QSGPlainTexture, need to do it in QSGPainterTexture as well, or red and blue channels will be swapped on OpenGL ES 2. Change-Id: I8b17a359b80d6c2e3b89d9c1d4c3d388a3ad1081 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
Diffstat (limited to 'src/quick/scenegraph/util/qsgpainternode.cpp')
-rw-r--r--src/quick/scenegraph/util/qsgpainternode.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/scenegraph/util/qsgpainternode.cpp b/src/quick/scenegraph/util/qsgpainternode.cpp
index 1ea64f6205..87a54d3124 100644
--- a/src/quick/scenegraph/util/qsgpainternode.cpp
+++ b/src/quick/scenegraph/util/qsgpainternode.cpp
@@ -73,6 +73,10 @@ QSGPainterTexture::QSGPainterTexture()
}
+#ifdef QT_OPENGL_ES
+extern void qsg_swizzleBGRAToRGBA(QImage *image);
+#endif
+
void QSGPainterTexture::bind()
{
if (m_dirty_rect.isNull()) {
@@ -91,6 +95,7 @@ void QSGPainterTexture::bind()
int h = m_dirty_rect.height();
#ifdef QT_OPENGL_ES
+ qsg_swizzleBGRAToRGBA(&subImage);
glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirty_rect.x(), m_dirty_rect.y(), w, h,
GL_RGBA, GL_UNSIGNED_BYTE, subImage.constBits());
#else