diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-04-29 07:54:44 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-04-29 07:54:44 (GMT) |
commit | dcaad8949ea1c1782d27b038f08e9a728c8e3fe5 (patch) | |
tree | 3cb49a22f79c5952de4e913146659990d614cd64 /src/opengl | |
parent | 917e4e3284a568eecfca26365cc0a545d0f4eb70 (diff) | |
parent | 6940070adb45d67a0a9186205a4914a0a6c14135 (diff) | |
download | Qt-dcaad8949ea1c1782d27b038f08e9a728c8e3fe5.zip Qt-dcaad8949ea1c1782d27b038f08e9a728c8e3fe5.tar.gz Qt-dcaad8949ea1c1782d27b038f08e9a728c8e3fe5.tar.bz2 |
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
All EGL-related changes from 4.6 were discarded.
Conflicts:
src/gui/egl/egl.pri
src/gui/egl/qegl.cpp
src/gui/egl/qegl_p.h
src/gui/egl/qegl_stub.cpp
src/gui/egl/qeglproperties_p.h
src/gui/egl/qeglproperties_stub.cpp
src/gui/gui.pro
src/multimedia/multimedia/audio/qaudioinput_win32_p.h
src/s60installs/bwins/QtGuiu.def
src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'src/opengl')
-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 72ed6be..bf77eda 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1637,7 +1637,14 @@ static void convertFromGLImage(QImage &img, int w, int h, bool alpha_format, boo 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); + if (alpha_format && include_alpha) { + *q = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) + | (pixel & 0xff00ff00); + } else { + *q = 0xff000000 | ((pixel << 16) & 0xff0000) + | ((pixel >> 16) & 0xff) | (pixel & 0x00ff00); + } + q++; } } @@ -1648,7 +1655,8 @@ static void convertFromGLImage(QImage &img, int w, int h, bool alpha_format, boo QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha) { - QImage img(size, alpha_format ? QImage::Format_ARGB32 : QImage::Format_RGB32); + QImage img(size, (alpha_format && include_alpha) ? QImage::Format_ARGB32 + : QImage::Format_RGB32); int w = size.width(); int h = size.height(); glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, img.bits()); |