summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2023-09-14 15:56:08 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2023-09-18 20:26:22 +0000
commitffb857e9d0745fdd31bca091333f1120c5857d7b (patch)
tree4742342bcf338a30e759e45189906d8cd959f75a /src/gui/painting
parent12d6fc5229196038af8d42cb0edec91766c1a1d4 (diff)
Sync rhi backingstore prefer-software env.var with Quick
Behaving differently in QQuickWindow vs. a QRhi-based widget window is not great for WebEngine. The env.var naming is not the best (QSG prefix) but we already have some precedent for this (recognizing QSG_INFO in QRhi), and there is no other choice anyway. Pick-to: 6.6 6.5 6.6.0 6.5.3 Task-number: QTBUG-116445 Change-Id: Ibfd495cbd1d42502441d6629325bdeb033e813f3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qbackingstorerhisupport.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/painting/qbackingstorerhisupport.cpp b/src/gui/painting/qbackingstorerhisupport.cpp
index d811abf648..3927367af6 100644
--- a/src/gui/painting/qbackingstorerhisupport.cpp
+++ b/src/gui/painting/qbackingstorerhisupport.cpp
@@ -56,6 +56,11 @@ bool QBackingStoreRhiSupport::create()
QOffscreenSurface *surface = nullptr;
QRhi::Flags flags;
+ // This must be the same env.var. Qt Quick uses, to ensure symmetry in the
+ // behavior between a QQuickWindow and a (QRhi-based) widget top-level window.
+ if (qEnvironmentVariableIntValue("QSG_RHI_PREFER_SOFTWARE_RENDERER"))
+ flags |= QRhi::PreferSoftwareRenderer;
+
if (m_config.api() == QPlatformBackingStoreRhiConfig::Null) {
QRhiNullInitParams params;
rhi = QRhi::create(QRhi::Null, &params, flags);