summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-04-22 22:09:59 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-04-22 22:16:39 (GMT)
commitd64d13102d3d53d0aa43597408d7abf3fecb57a3 (patch)
tree898e9120d7829c0a11e29e2e55fd24ca3164890e /src
parent08218fb6dbcc4f133c20cdc3a4e6575606924a29 (diff)
downloadQt-d64d13102d3d53d0aa43597408d7abf3fecb57a3.zip
Qt-d64d13102d3d53d0aa43597408d7abf3fecb57a3.tar.gz
Qt-d64d13102d3d53d0aa43597408d7abf3fecb57a3.tar.bz2
Convert bitmaps to alpha pixmap format
Ideally we'd let raster pixmap data handle this but QPixmap::fromImage creates a QPixmapData::PixmapType regardless of the bit depth of the image so we have to handle this case. Reviewed-by: Donald <qt-info@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index f9172cc..ea9bb3a 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -157,13 +157,13 @@ static bool checkForAlphaPixels(const QImage &img)
return false;
}
-void QDirectFBPixmapData::fromImage(const QImage &img,
+void QDirectFBPixmapData::fromImage(const QImage &i,
Qt::ImageConversionFlags flags)
{
#ifdef QT_NO_DIRECTFB_OPAQUE_DETECTION
Q_UNUSED(flags);
#endif
- Q_ASSERT(img.depth() != 1); // these should be handled by QRasterPixmapData
+ const QImage img = (i.depth() == 1 ? i.convertToFormat(screen->alphaPixmapFormat()) : i);
if (img.hasAlphaChannel()
#ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION
&& (flags & Qt::NoOpaqueDetection || ::checkForAlphaPixels(img))