From 02854249301c599a589405d5d02218bc31fcc1ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Tue, 6 Aug 2024 10:44:14 +0200 Subject: [PATCH] Enable WIDGETS_RHI when HIGHDPI_DOWNSCALE is set QT_WIDGETS_HIGHDPI_DOWNSCALE requires the rhi backing store backend for GPU downscaling. Enable that automatically to make the downscale functionality easier to use. Change-Id: I27a538fef426768fe69fcfe07104136209b3bae2 Reviewed-by: Eirik Aavitsland (cherry picked from commit 672310c74691c60b303520c69287d73d07ab32a1) Reviewed-by: Qt Cherry-pick Bot --- src/gui/painting/qbackingstorerhisupport.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qbackingstorerhisupport.cpp b/src/gui/painting/qbackingstorerhisupport.cpp index 37c52155eb4..1f90e743d5a 100644 --- a/src/gui/painting/qbackingstorerhisupport.cpp +++ b/src/gui/painting/qbackingstorerhisupport.cpp @@ -265,7 +265,10 @@ bool QBackingStoreRhiSupport::checkForceRhi(QPlatformBackingStoreRhiConfig *outC checked = true; const bool alwaysRhi = qEnvironmentVariableIntValue("QT_WIDGETS_RHI"); - if (alwaysRhi) + const bool highdpiDownscale = qEnvironmentVariableIntValue("QT_WIDGETS_HIGHDPI_DOWNSCALE"); + if (highdpiDownscale) + qCDebug(lcQpaBackingStore) << "Enabling QT_WIDGETS_RHI due to QT_WIDGETS_HIGHDPI_DOWNSCALE"; + if (alwaysRhi || highdpiDownscale) config.setEnabled(true); // if enabled, choose an api