diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/image/qpixmap_x11.cpp | 11 | ||||
-rw-r--r-- | src/gui/image/qpixmap_x11_p.h | 1 | ||||
-rw-r--r-- | src/gui/image/qpixmapdata.cpp | 5 | ||||
-rw-r--r-- | src/gui/image/qpixmapdata_p.h | 1 |
4 files changed, 17 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 3d9c363..32676ba 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -1321,6 +1321,15 @@ QBitmap QX11PixmapData::mask() const return mask; } +bool QX11PixmapData::hasMask() const +{ + return +#ifndef QT_NO_XRENDER + (picture && d == 32) || +#endif + (d == 1) || x11_mask; +} + /*! Sets a mask bitmap. @@ -1549,7 +1558,7 @@ QImage QX11PixmapData::toImage(const QRect &rect) const if (!xiWrapper.xi) return QImage(); - if (canTakeQImageFromXImage(xiWrapper)) + if (!x11_mask && canTakeQImageFromXImage(xiWrapper)) return takeQImageFromXImage(xiWrapper); QImage image = toImage(xiWrapper, rect); diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h index 821fb69..fcad1a2 100644 --- a/src/gui/image/qpixmap_x11_p.h +++ b/src/gui/image/qpixmap_x11_p.h @@ -82,6 +82,7 @@ public: void fill(const QColor &color); QBitmap mask() const; + bool hasMask() const; void setMask(const QBitmap &mask); bool hasAlphaChannel() const; void setAlphaChannel(const QPixmap &alphaChannel); diff --git a/src/gui/image/qpixmapdata.cpp b/src/gui/image/qpixmapdata.cpp index ef1f6c4..2813ed1 100644 --- a/src/gui/image/qpixmapdata.cpp +++ b/src/gui/image/qpixmapdata.cpp @@ -239,6 +239,11 @@ QBitmap QPixmapData::mask() const return QBitmap::fromImage(mask); } +bool QPixmapData::hasMask() const +{ + return hasAlphaChannel(); +} + QPixmap QPixmapData::transformed(const QTransform &matrix, Qt::TransformationMode mode) const { diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h index ec62b0b..c341930 100644 --- a/src/gui/image/qpixmapdata_p.h +++ b/src/gui/image/qpixmapdata_p.h @@ -99,6 +99,7 @@ public: virtual int metric(QPaintDevice::PaintDeviceMetric metric) const = 0; virtual void fill(const QColor &color) = 0; virtual QBitmap mask() const; + virtual bool hasMask() const; virtual void setMask(const QBitmap &mask); virtual bool hasAlphaChannel() const = 0; virtual QPixmap transformed(const QTransform &matrix, |