summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-06-04 16:07:38 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-06-07 02:27:59 (GMT)
commit6b434dfbb1b2ee518680c525fb3289e98feff73c (patch)
treeeaff63be9f5b60e360de165ea655378578d9aca6
parent7a20e5e60d938531e250a974d3c8d4d1a6778391 (diff)
downloadQt-6b434dfbb1b2ee518680c525fb3289e98feff73c.zip
Qt-6b434dfbb1b2ee518680c525fb3289e98feff73c.tar.gz
Qt-6b434dfbb1b2ee518680c525fb3289e98feff73c.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> (cherry picked from commit f7338759ef86deba18b27ee72b3afcf40f3a5aaf)
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index 8ed72b1..11fea43 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 {