diff options
author | Anders Bakken <anders.bakken@nokia.com> | 2009-06-04 16:07:38 (GMT) |
---|---|---|
committer | Anders Bakken <anders.bakken@nokia.com> | 2009-06-04 16:07:38 (GMT) |
commit | f7338759ef86deba18b27ee72b3afcf40f3a5aaf (patch) | |
tree | c7409de49a47fc610460f7f6c6330096b8e0bc69 /src/plugins/gfxdrivers | |
parent | 398c022e8adefc6e71a6048da40c19f6169be831 (diff) | |
download | Qt-f7338759ef86deba18b27ee72b3afcf40f3a5aaf.zip Qt-f7338759ef86deba18b27ee72b3afcf40f3a5aaf.tar.gz Qt-f7338759ef86deba18b27ee72b3afcf40f3a5aaf.tar.bz2 |
Make sure to retain alpha information in copy
We need to set alpha to the right value when copying pixmaps.
Reviewed-by: Donald <qt-info@nokia.com>
Diffstat (limited to 'src/plugins/gfxdrivers')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index dba1b51..18754f5 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -202,11 +202,12 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) } IDirectFBSurface *src = static_cast<const QDirectFBPixmapData*>(data)->directFBSurface(); - const bool hasAlpha = data->hasAlphaChannel(); - format = (hasAlpha + alpha = data->hasAlphaChannel(); + format = (alpha ? QDirectFBScreen::instance()->alphaPixmapFormat() : QDirectFBScreen::instance()->pixelFormat()); + dfbSurface = screen->createDFBSurface(rect.size(), format, QDirectFBScreen::TrackSurface); if (!dfbSurface) { @@ -215,7 +216,7 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) return; } - if (hasAlpha) { + if (alpha) { dfbSurface->Clear(dfbSurface, 0, 0, 0, 0); dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_BLEND_ALPHACHANNEL); } else { |