diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-04-29 14:51:25 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-04-29 14:51:25 (GMT) |
commit | 9b707c0a12e01f8b0c4432b6a5d391b8699cfd3a (patch) | |
tree | 24c920bbba7bc5d2d7dedd7c5a8756376f3c7b4b /src/opengl/qgl.cpp | |
parent | a63298440dcddc844554e012434c3331ca239db4 (diff) | |
parent | d51939831552ef73e8f33365c1ef77322594512c (diff) | |
download | Qt-9b707c0a12e01f8b0c4432b6a5d391b8699cfd3a.zip Qt-9b707c0a12e01f8b0c4432b6a5d391b8699cfd3a.tar.gz Qt-9b707c0a12e01f8b0c4432b6a5d391b8699cfd3a.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r-- | src/opengl/qgl.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 18d9125..2d58084 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1328,13 +1328,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(); } |