summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_context.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2020-07-08 17:11:18 +0200
committerMichal Klocek <michal.klocek@qt.io>2020-08-05 14:00:34 +0200
commit28c90c8ab4f8ec2833d5cc46be67b78ba4cf4ccc (patch)
treea12eb0819fa44b61ddb3a59d1f54d3d48c7aa0e9 /src/core/web_engine_context.cpp
parentb3580a2da3b1bad8913e3a86eea37bdb6be01a4d (diff)
Dump info about webenginecontext
Change-Id: I96a64d83f6bb4ee7c6dfcc9be52ecc5f9378219b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r--src/core/web_engine_context.cpp34
1 files changed, 33 insertions, 1 deletions
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 <QNetworkProxy>
#include <QtGui/qpa/qplatformintegration.h>
#include <QtGui/private/qguiapplication_p.h>
+#include <QLoggingCategory>
#if QT_CONFIG(opengl)
QT_BEGIN_NAMESPACE
@@ -248,6 +249,35 @@ void dummyGetPluginCallback(const std::vector<content::WebPluginInfo>&)
}
#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<QSurfaceFormat::OpenGLContextProfile>().valueToKey(
+ sharedFormat.profile());
+ const auto type = QMetaEnum::fromType<QSurfaceFormat::RenderableType>().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)