diff options
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r-- | src/core/web_engine_context.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index bda57aab2..31e78e7d0 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -494,6 +494,17 @@ const static char kChromiumFlagsEnv[] = "QTWEBENGINE_CHROMIUM_FLAGS"; const static char kDisableSandboxEnv[] = "QTWEBENGINE_DISABLE_SANDBOX"; const static char kDisableInProcGpuThread[] = "QTWEBENGINE_DISABLE_GPU_THREAD"; +// static +bool WebEngineContext::isGpuServiceOnUIThread() +{ + static bool threadedGpu = +#if QT_CONFIG(opengl) && !defined(Q_OS_MACOS) + QOpenGLContext::supportsThreadedOpenGL() && +#endif + !qEnvironmentVariableIsSet(kDisableInProcGpuThread); + return !threadedGpu; +} + static void appendToFeatureList(std::string &featureList, const char *feature) { if (featureList.empty()) @@ -602,16 +613,6 @@ WebEngineContext::WebEngineContext() if (isDesktopGLOrSoftware || isGLES2Context) parsedCommandLine->AppendSwitch(switches::kDisableES3GLContext); #endif - bool threadedGpu = false; -#if QT_CONFIG(opengl) - threadedGpu = QOpenGLContext::supportsThreadedOpenGL(); -#if defined(Q_OS_MACOS) - // QtBase disabled it when building on 10.14+, unfortunately we still need it - // until we have fixed single-threaded viz-display-compositor. - threadedGpu = true; -#endif -#endif - threadedGpu = threadedGpu && !qEnvironmentVariableIsSet(kDisableInProcGpuThread); std::string disableFeatures; std::string enableFeatures; @@ -744,7 +745,7 @@ WebEngineContext::WebEngineContext() parsedCommandLine->AppendSwitch(switches::kDisableGpu); } - registerMainThreadFactories(threadedGpu); + registerMainThreadFactories(); SetContentClient(new ContentClientQt); |