summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2022-09-01 09:33:28 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-16 13:19:21 +0000
commit27b560cbf0edba661d4536e5b3ec2f34f625756f (patch)
tree081215500f604fd3512ed427c0fc8e5c6820badf
parent1d123e0301614d9f4b8c27787e3c52ae20731458 (diff)
Check QT_OPENGL for software
According to qt docs this variable should have same effect like setting Qt::AA_UseSoftwareOpenGL on application, therefore read that in case of detecting the software mode. Task-number: QTBUG-106095 Change-Id: I00fa8f0607ca44533c445434d1a35a1524bab679 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit fd1e82d0c09c73e42f172ffdf7edbcc952232155) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/core/web_engine_context.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 2edd02830..e99726d7a 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -185,8 +185,15 @@ static bool usingSupportedSGBackend()
bool usingSoftwareDynamicGL()
{
+ const char openGlVar[] = "QT_OPENGL";
if (QCoreApplication::testAttribute(Qt::AA_UseSoftwareOpenGL))
return true;
+
+ if (qEnvironmentVariableIsSet(openGlVar)) {
+ const QByteArray requested = qgetenv(openGlVar);
+ if (requested == "software")
+ return true;
+ }
#if defined(Q_OS_WIN)
HMODULE handle = QNativeInterface::QWGLContext::openGLModuleHandle();
wchar_t path[MAX_PATH];