From ffb857e9d0745fdd31bca091333f1120c5857d7b Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 14 Sep 2023 15:56:08 +0200 Subject: 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 --- src/gui/painting/qbackingstorerhisupport.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gui/painting') 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, ¶ms, flags); -- cgit v1.2.3