From 28c90c8ab4f8ec2833d5cc46be67b78ba4cf4ccc Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 8 Jul 2020 17:11:18 +0200 Subject: Dump info about webenginecontext Change-Id: I96a64d83f6bb4ee7c6dfcc9be52ecc5f9378219b Reviewed-by: Allan Sandfeld Jensen --- src/core/web_engine_context.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'src/core/web_engine_context.cpp') diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 5e3b19029..4ae5d7e07 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -135,6 +135,7 @@ #include #include #include +#include #if QT_CONFIG(opengl) QT_BEGIN_NAMESPACE @@ -248,6 +249,35 @@ void dummyGetPluginCallback(const std::vector&) } #endif +static void logContext(const char *glType, base::CommandLine *cmd) +{ + QLoggingCategory webEngineContextLog("qt.webenginecontext"); + if (webEngineContextLog.isInfoEnabled()) { + const QSurfaceFormat sharedFormat = qt_gl_global_share_context()->format(); + const auto profile = QMetaEnum::fromType().valueToKey( + sharedFormat.profile()); + const auto type = QMetaEnum::fromType().valueToKey( + sharedFormat.renderableType()); + const base::CommandLine::SwitchMap switch_map = cmd->GetSwitches(); + QStringList params; + for (const auto &pair : switch_map) + params << " * " << toQt(pair.first) + << toQt(pair.second) << "\n"; + qCInfo(webEngineContextLog, + "\n\nGLImplementation: %s\n" + "Surface Type: %s\n" + "Surface Profile: %s\n" + "Surface Version: %d.%d\n" + "Using Default SG Backend: %s\n" + "Using Software Dynamic GL: %s\n" + "Using Angle: %s\n\n" + "Init Parameters:\n %s", + glType, type, profile, sharedFormat.majorVersion(), sharedFormat.minorVersion(), + usingDefaultSGBackend() ? "yes" : "no", usingSoftwareDynamicGL() ? "yes" : "no", + usingANGLE() ? "yes" : "no", qPrintable(params.join(" "))); + } +} + #if defined(Q_OS_WIN) sandbox::SandboxInterfaceInfo *staticSandboxInterfaceInfo(sandbox::SandboxInterfaceInfo *info) { @@ -720,7 +750,7 @@ WebEngineContext::WebEngineContext() parsedCommandLine->AppendSwitch(switches::kDisableGpuRasterization); parsedCommandLine->AppendSwitch(switches::kIgnoreGpuBlacklist); } - QSurfaceFormat sharedFormat = qt_gl_global_share_context()->format(); + const QSurfaceFormat sharedFormat = qt_gl_global_share_context()->format(); if (sharedFormat.profile() == QSurfaceFormat::CompatibilityProfile) parsedCommandLine->AppendSwitch(switches::kCreateDefaultGLContext); } else { @@ -806,6 +836,8 @@ WebEngineContext::WebEngineContext() #endif content::WebUIControllerFactory::RegisterFactory(WebUIControllerFactoryQt::GetInstance()); + + logContext(glType, parsedCommandLine); } #if QT_CONFIG(webengine_printing_and_pdf) -- cgit v1.2.3