summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbbackingstore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbbackingstore.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index 212fc722c0..e3686ec010 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -73,6 +73,8 @@ public:
QSize size() const { return m_qimage.size(); }
+ bool hasAlpha() const { return m_hasAlpha; }
+
void put(xcb_window_t window, const QPoint &dst, const QRect &source);
void preparePaint(const QRegion &region);
@@ -90,6 +92,8 @@ private:
xcb_window_t m_gc_window;
QRegion m_dirty;
+
+ bool m_hasAlpha;
};
class QXcbShmGraphicsBuffer : public QPlatformGraphicsBuffer
@@ -179,7 +183,8 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
qWarning() << "QXcbBackingStore: Error while marking the shared memory segment to be destroyed";
}
- if (QImage::toPixelFormat(format).alphaUsage() == QPixelFormat::IgnoresAlpha)
+ m_hasAlpha = QImage::toPixelFormat(format).alphaUsage() == QPixelFormat::UsesAlpha;
+ if (!m_hasAlpha)
format = qt_alphaVersionForPainting(format);
m_qimage = QImage( (uchar*) m_xcb_image->data, m_xcb_image->width, m_xcb_image->height, m_xcb_image->stride, format);
@@ -330,7 +335,7 @@ void QXcbBackingStore::beginPaint(const QRegion &region)
m_paintRegion = region;
m_image->preparePaint(m_paintRegion);
- if (m_image->image()->hasAlphaChannel()) {
+ if (m_image->hasAlpha()) {
QPainter p(paintDevice());
p.setCompositionMode(QPainter::CompositionMode_Source);
const QVector<QRect> rects = m_paintRegion.rects();