diff options
author | Anders Bakken <anders.bakken@nokia.com> | 2009-09-29 01:37:25 (GMT) |
---|---|---|
committer | Anders Bakken <anders.bakken@nokia.com> | 2009-09-29 01:45:40 (GMT) |
commit | aa8865b37520cf591ae795895f4a38d5ad86c17a (patch) | |
tree | 06ab5e687309a7a33f626f1e2a50c48aa49a8a01 /src/plugins | |
parent | b88817e481f2cc2aea0787fe355659b581599abb (diff) | |
download | Qt-aa8865b37520cf591ae795895f4a38d5ad86c17a.zip Qt-aa8865b37520cf591ae795895f4a38d5ad86c17a.tar.gz Qt-aa8865b37520cf591ae795895f4a38d5ad86c17a.tar.bz2 |
Fix a alpha issue with RGB32 and DirectFB
Since we can't use RGB32 format with DirectFB (issues regarding Qt's
assumptions about the alpha byte) we need to explicitly convert images
of this type to the preferred alphaPixmap format.
This fixes an issue where RGB32 images get a curious gray alpha overlay.
Reviewed-by: Noam Rosenthal <noam.rosenthal@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index ce9a55c..b15888b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -288,7 +288,7 @@ bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescripti void QDirectFBPixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags) { - if (img.depth() == 1) { + if (img.depth() == 1 || img.format() == QImage::Format_RGB32) { fromImage(img.convertToFormat(screen->alphaPixmapFormat()), flags); return; } @@ -308,6 +308,8 @@ void QDirectFBPixmapData::fromImage(const QImage &img, if (flags != Qt::AutoColor) { image = img.convertToFormat(imageFormat, flags); flags = Qt::AutoColor; + } else if (img.format() == QImage::Format_RGB32) { + image = img.convertToFormat(imageFormat, flags); } else { image = img; } @@ -332,6 +334,7 @@ void QDirectFBPixmapData::fromImage(const QImage &img, } else { dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX); } + dfbSurface->Blit(dfbSurface, imageSurface, 0, 0, 0); imageSurface->Release(imageSurface); |