diff options
author | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-09-23 12:10:59 +0200 |
---|---|---|
committer | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-09-23 12:13:05 +0200 |
commit | d1817df87461fc071527eb77d3c1259e713b94a4 (patch) | |
tree | 1259e69aa9b6bb1a19ea937cc1b96635c0b6b162 /src/gui/image/qpixmap.cpp | |
parent | 6397e5bc49f11e20a9d1838d8d8df46dd9486263 (diff) |
Compile on Symbian - rework the X11 mask patch a bit.
Avoid adding a virtual QPixmapData::hasMask() function, we can
do without it. Made QPixmap::hasAlpha() fast, so we can use that
instead.
Reviewed-by: Samuel
Diffstat (limited to 'src/gui/image/qpixmap.cpp')
-rw-r--r-- | src/gui/image/qpixmap.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 6a13f49363..64d8ed2d4f 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1798,13 +1798,27 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode) Returns true if this pixmap has an alpha channel, \e or has a mask, otherwise returns false. - \warning This is potentially an expensive operation. - \sa hasAlphaChannel(), mask() */ bool QPixmap::hasAlpha() const { - return data && (data->hasAlphaChannel() || !data->mask().isNull()); +#if defined(Q_WS_X11) + if (data && data->hasAlphaChannel()) + return true; + QPixmapData *pd = pixmapData(); + if (pd && pd->classId() == QPixmapData::X11Class) { + QX11PixmapData *x11Data = static_cast<QX11PixmapData*>(pd); +#ifndef QT_NO_XRENDER + if (x11Data->picture && x11Data->d == 32) + return true; +#endif + if (x11Data->d == 1 || x11Data->x11_mask) + return true; + } + return false; +#else + return data && data->hasAlphaChannel(); +#endif } /*! |