diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2010-06-23 11:33:20 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2010-06-23 11:35:20 (GMT) |
commit | 0c0eac000ecbe8c0bdcb8c6d914854b1a09a720b (patch) | |
tree | bf07accf152b8ee4baf234f22137c6ddf9a8b5df /src | |
parent | fb76a872e20bd0df8e7bbe9c039b7f20423c6f12 (diff) | |
download | Qt-0c0eac000ecbe8c0bdcb8c6d914854b1a09a720b.zip Qt-0c0eac000ecbe8c0bdcb8c6d914854b1a09a720b.tar.gz Qt-0c0eac000ecbe8c0bdcb8c6d914854b1a09a720b.tar.bz2 |
Fixed QPixmap::toImage() bug introduced in fb76a872e20bd.
The alpha channel we get from XGetImage might not be saturated for
opaque pixmaps.
Reviewed-by: Trond
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qpixmap_x11.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 604dbf5..3d9c363 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -1525,6 +1525,16 @@ QImage QX11PixmapData::takeQImageFromXImage(const QXImageWrapper &xiWrapper) con } } + // fix-up alpha channel + if (format == QImage::Format_RGB32) { + QRgb *p = (QRgb *)image.bits(); + for (int y = 0; y < xi->height; ++y) { + for (int x = 0; x < xi->width; ++x) + p[x] |= 0xff000000; + p += xi->bytes_per_line / 4; + } + } + XDestroyImage(xi); return image; } |