From f7338759ef86deba18b27ee72b3afcf40f3a5aaf Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 4 Jun 2009 09:07:38 -0700 Subject: Make sure to retain alpha information in copy We need to set alpha to the right value when copying pixmaps. Reviewed-by: Donald --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 7 ++++--- 1 file 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(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 { -- cgit v0.12