summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-04-07 03:25:12 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-04-07 03:29:57 (GMT)
commitf70dcb0ed48bb393d3e7ed8941e98f1e52fff80e (patch)
tree02742ccfe586c6990eaabf4596ee86725612a4d3 /src
parent018edd573eac026f861e97ffab611b4eeb059830 (diff)
downloadQt-f70dcb0ed48bb393d3e7ed8941e98f1e52fff80e.zip
Qt-f70dcb0ed48bb393d3e7ed8941e98f1e52fff80e.tar.gz
Qt-f70dcb0ed48bb393d3e7ed8941e98f1e52fff80e.tar.bz2
Improve QDirectFBPixmapData::transformed
Make sure we keep retain alpha if there is one in the source. Reviewed-by: TrustMe
Diffstat (limited to 'src')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index 6857d96..ee60302 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -231,13 +231,22 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
return QPixmap();
QDirectFBPixmapData *data = new QDirectFBPixmapData(QPixmapData::PixmapType);
- data->resize(size.width(), size.height());
-
- IDirectFBSurface *dest = data->dfbSurface;
- dest->SetBlittingFlags(dest, DSBLIT_NOFX);
+ QImage::Format format = screen->pixelFormat();
+ DFBSurfaceBlittingFlags flags = DSBLIT_NOFX;
+ if (hasAlphaChannel()) {
+ flags = DSBLIT_BLEND_ALPHACHANNEL;
+ format = screen->alphaPixmapFormat();
+ }
+ data->dfbSurface = screen->createDFBSurface(size,
+ format,
+ QDirectFBScreen::TrackSurface);
+ if (flags & DSBLIT_BLEND_ALPHACHANNEL) {
+ data->dfbSurface->Clear(data->dfbSurface, 0, 0, 0, 0);
+ }
+ data->dfbSurface->SetBlittingFlags(data->dfbSurface, flags);
const DFBRectangle destRect = { 0, 0, size.width(), size.height() };
- dest->StretchBlit(dest, dfbSurface, 0, &destRect);
+ data->dfbSurface->StretchBlit(data->dfbSurface, dfbSurface, 0, &destRect);
return QPixmap(data);
}