summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jkobus@trolltech.com>2009-04-29 12:48:46 (GMT)
committerJarek Kobus <jkobus@trolltech.com>2009-04-29 12:48:46 (GMT)
commitd51939831552ef73e8f33365c1ef77322594512c (patch)
tree5661175cbee710d723491f5eadf43b9016ea3e09 /src/opengl/qgl.cpp
parent77a0de016ed8afc60a3d8b961b65b94b37d87036 (diff)
parent660907a80e8a3f23f70cd5039407c0cc679af9f3 (diff)
downloadQt-d51939831552ef73e8f33365c1ef77322594512c.zip
Qt-d51939831552ef73e8f33365c1ef77322594512c.tar.gz
Qt-d51939831552ef73e8f33365c1ef77322594512c.tar.bz2
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r--src/opengl/qgl.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 8ffee87..04bc611 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1327,13 +1327,21 @@ QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include
// This is an old legacy fix for PowerPC based Macs, which
// we shouldn't remove
while (p < end) {
- *p = 0xFF000000 | (*p>>8);
+ *p = 0xff000000 | (*p>>8);
++p;
}
}
} else {
// OpenGL gives ABGR (i.e. RGBA backwards); Qt wants ARGB
- img = img.rgbSwapped();
+ for (int y = 0; y < h; y++) {
+ uint *q = (uint*)img.scanLine(y);
+ for (int x=0; x < w; ++x) {
+ const uint pixel = *q;
+ *q = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) | (pixel & 0xff00ff00);
+ q++;
+ }
+ }
+
}
return img.mirrored();
}