summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-10-05 11:14:11 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-10-05 11:21:08 (GMT)
commitb8b13494ed151595c5fc104572655f667870e6e1 (patch)
tree843bbb44edc402d08236d3711d75789ee5c7cdbf /src/gui
parent3474f3db5737218ca403885e94826a07ddc915b2 (diff)
downloadQt-b8b13494ed151595c5fc104572655f667870e6e1.zip
Qt-b8b13494ed151595c5fc104572655f667870e6e1.tar.gz
Qt-b8b13494ed151595c5fc104572655f667870e6e1.tar.bz2
Made X11 pixmap backend's fromImage() check for Qt::NoOpaqueDetection.
Reviewed-by: Gunnar
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/qpixmap_x11.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index 92a7e7d..74543a0 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -387,7 +387,14 @@ struct QX11AlphaDetector
return hasAlpha();
}
- QX11AlphaDetector(const QImage *i) : image(i), checked(false), has(false) { }
+ QX11AlphaDetector(const QImage *i, Qt::ImageConversionFlags flags)
+ : image(i), checked(false), has(false)
+ {
+ if (flags & Qt::NoOpaqueDetection) {
+ checked = true;
+ has = image->hasAlphaChannel();
+ }
+ }
const QImage *image;
mutable bool checked;
@@ -427,7 +434,7 @@ void QX11PixmapData::fromImage(const QImage &img,
return;
}
- QX11AlphaDetector alphaCheck(&img);
+ QX11AlphaDetector alphaCheck(&img, flags);
int dd = alphaCheck.hasXRenderAndAlpha() ? 32 : xinfo.depth();
if (qt_x11_preferred_pixmap_depth)