From d64d13102d3d53d0aa43597408d7abf3fecb57a3 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 22 Apr 2009 15:09:59 -0700 Subject: 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 --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 4 ++-- 1 file 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)) -- cgit v0.12