summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandquickitem.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2022-02-11 09:11:00 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2022-02-17 07:53:46 +0100
commit00323844defd67b0edc76db1c56ba32433a232bf (patch)
treeb7470038435703fdf9dc3f8e44df78b4d24ea169 /src/compositor/compositor_api/qwaylandquickitem.cpp
parent824ac51444e7df1420e9d35b94fd3efd204f9cc9 (diff)
Use opaque render list when client content is opaque
If the client says it's fully opaque through the set_opaque_region request, we can disable blending for the item and potentially improve performance a little bit. [ChangeLog][QtWaylandCompositor] The compositor now respects the opaque region set by the client and no longer applies blending or overdraw for fully opaque windows. Fixes: QTBUG-100373 Change-Id: Iaa68fbf1f086d926c9c1867d981a63810f4ca855 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandquickitem.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index bf1d0a447..07130a8a6 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -372,7 +372,7 @@ void QWaylandBufferMaterial::setBufferRef(QWaylandQuickItem *surfaceItem, const
if (auto texture = ref.toOpenGLTexture(plane)) {
QQuickWindow::CreateTextureOptions opt;
QWaylandQuickSurface *waylandSurface = qobject_cast<QWaylandQuickSurface *>(surfaceItem->surface());
- if (waylandSurface != nullptr && waylandSurface->useTextureAlpha())
+ if (waylandSurface != nullptr && waylandSurface->useTextureAlpha() && !waylandSurface->isOpaque())
opt |= QQuickWindow::TextureHasAlphaChannel;
QSGTexture *scenegraphTexture;
if (ref.bufferFormatEgl() == QWaylandBufferRef::BufferFormatEgl_EXTERNAL_OES) {
@@ -422,7 +422,7 @@ public:
#if QT_CONFIG(opengl)
QQuickWindow::CreateTextureOptions opt;
QWaylandQuickSurface *surface = qobject_cast<QWaylandQuickSurface *>(surfaceItem->surface());
- if (surface && surface->useTextureAlpha()) {
+ if (surface && surface->useTextureAlpha() && !surface->isOpaque()) {
opt |= QQuickWindow::TextureHasAlphaChannel;
}