diff options
author | Anders Bakken <anders.bakken@nokia.com> | 2009-04-07 03:25:12 (GMT) |
---|---|---|
committer | Anders Bakken <anders.bakken@nokia.com> | 2009-04-07 03:29:57 (GMT) |
commit | f70dcb0ed48bb393d3e7ed8941e98f1e52fff80e (patch) | |
tree | 02742ccfe586c6990eaabf4596ee86725612a4d3 | |
parent | 018edd573eac026f861e97ffab611b4eeb059830 (diff) | |
download | Qt-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
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 19 |
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); } |