summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-21 10:41:06 (GMT)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-21 10:45:49 (GMT)
commit589fb7812ac81192a7013c0b186354f121118398 (patch)
tree7ecf689287e8e19641c46b710c37d6a6477bcc7b /src/gui
parentcd786ac3223a515c57222ac78dac568601bc6d2e (diff)
downloadQt-589fb7812ac81192a7013c0b186354f121118398.zip
Qt-589fb7812ac81192a7013c0b186354f121118398.tar.gz
Qt-589fb7812ac81192a7013c0b186354f121118398.tar.bz2
Changed s60 style not to rely on QPixmapData::toNativeType().
Forcing VG (and GL) pixmapdata to support toNativeType() with type VolatileImage is unnecessary. It is cleaner to try doing a fromNativeType() with bitmap+mask and fall back if that results in a null pixmapdata. Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/styles/qs60style_s60.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 1ff195d..e46c826 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -639,13 +639,14 @@ QPixmap QS60StyleModeSpecifics::fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask
QPixmap pixmap;
QScopedPointer<QPixmapData> pd(QPixmapData::create(0, 0, QPixmapData::PixmapType));
- bool nativeMaskSupported = (pd->toNativeType(QPixmapData::VolatileImage) != 0);
- if (mask && nativeMaskSupported) {
- // Efficient path, less copying and conversion.
+ if (mask) {
+ // Try the efficient path with less copying and conversion.
QVolatileImage img(icon, mask);
pd->fromNativeType(&img, QPixmapData::VolatileImage);
- pixmap = QPixmap(pd.take());
- } else {
+ if (!pd->isNull())
+ pixmap = QPixmap(pd.take());
+ }
+ if (pixmap.isNull()) {
// Potentially more expensive path.
pd->fromNativeType(icon, QPixmapData::FbsBitmap);
pixmap = QPixmap(pd.take());