summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-04-07 15:19:52 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-04-07 15:23:47 (GMT)
commit5d6b7757eebc76018eedd2fdfb5135df7b5cb460 (patch)
tree66b18ced6955dc2f48f5e35f032173f8f1c271e9 /src/plugins/gfxdrivers
parent76608a9c51f4cd5309a5fec1af40c4d80089adf5 (diff)
downloadQt-5d6b7757eebc76018eedd2fdfb5135df7b5cb460.zip
Qt-5d6b7757eebc76018eedd2fdfb5135df7b5cb460.tar.gz
Qt-5d6b7757eebc76018eedd2fdfb5135df7b5cb460.tar.bz2
Make sure to clear surface in toImage
It seems DirectFB doesn't preserve alpha value of a blit unless BLEND is specified and if it is we need to Clear to transparent first. Reviewed-by: TrustMe
Diffstat (limited to 'src/plugins/gfxdrivers')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index 35ab859..a20b66a 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -250,7 +250,12 @@ QImage QDirectFBPixmapData::toImage() const
#ifndef QT_NO_DIRECTFB_PREALLOCATED
QImage ret(size(), QDirectFBScreen::getImageFormat(dfbSurface));
if (IDirectFBSurface *imgSurface = screen->createDFBSurface(ret, QDirectFBScreen::DontTrackSurface)) {
- imgSurface->SetBlittingFlags(imgSurface, hasAlphaChannel() ? DSBLIT_BLEND_ALPHACHANNEL : DSBLIT_NOFX);
+ if (hasAlphaChannel()) {
+ imgSurface->SetBlittingFlags(imgSurface, DSBLIT_BLEND_ALPHACHANNEL);
+ imgSurface->Clear(imgSurface, 0, 0, 0, 0);
+ } else {
+ imgSurface->SetBlittingFlags(imgSurface, DSBLIT_NOFX);
+ }
imgSurface->Blit(imgSurface, dfbSurface, 0, 0, 0);
imgSurface->ReleaseSource(imgSurface);
imgSurface->Release(imgSurface);