diff options
author | Tasuku Suzuki <tasuku.suzuki@qt.io> | 2017-06-17 15:28:49 +0900 |
---|---|---|
committer | Tasuku Suzuki <tasuku.suzuki@qt.io> | 2017-06-19 00:08:41 +0000 |
commit | 29dbb9acede3f5d9e477fdedd53d04be4136c0de (patch) | |
tree | 0b932b70b1bb353c2ca36eca946899ec71d6169e /src/client/qwaylandshmbackingstore.cpp | |
parent | af4d463cc8f4f404ffe406f77a01fac5b4be49b7 (diff) |
Translucent background support
Change-Id: I6e7b5869097f579020c7a4439441a63a0771e955
Task-number: QTBUG-55956
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/client/qwaylandshmbackingstore.cpp')
-rw-r--r-- | src/client/qwaylandshmbackingstore.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index 0afdda4c0..045748a16 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -171,12 +171,20 @@ QPaintDevice *QWaylandShmBackingStore::paintDevice() return contentSurface(); } -void QWaylandShmBackingStore::beginPaint(const QRegion &) +void QWaylandShmBackingStore::beginPaint(const QRegion ®ion) { mPainting = true; ensureSize(); waylandWindow()->setCanResize(false); + + if (mBackBuffer->image()->hasAlphaChannel()) { + QPainter p(paintDevice()); + p.setCompositionMode(QPainter::CompositionMode_Source); + const QColor blank = Qt::transparent; + for (const QRect &rect : region) + p.fillRect(rect, blank); + } } void QWaylandShmBackingStore::endPaint() |