summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/doc/src/qtwebengine-debugging.qdoc11
-rw-r--r--src/core/web_engine_context.cpp37
2 files changed, 29 insertions, 19 deletions
diff --git a/src/core/doc/src/qtwebengine-debugging.qdoc b/src/core/doc/src/qtwebengine-debugging.qdoc
index 3599ec55e..3bb6a7029 100644
--- a/src/core/doc/src/qtwebengine-debugging.qdoc
+++ b/src/core/doc/src/qtwebengine-debugging.qdoc
@@ -92,6 +92,15 @@
QTWEBENGINE_CHROMIUM_FLAGS="--disable-logging" mybrowser
\endcode
- QTWEBENGINE_CHROMIUM_FLAGS can also be set using {qputenv} from within the
+ QTWEBENGINE_CHROMIUM_FLAGS can also be set using \c qputenv from within the
application if called before QtWebEngineQuick::initialize().
+
+ \section1 Dump WebEngineContext Information
+
+ For dumping the WebEngineContext information, you can set the \c QT_LOGGING_RULES
+ environment variable to \c "qt.webenginecontext.debug=true".
+
+ The output contains information about the graphical backend, and the way how \QWE
+ is initialized for the application. This is particularly useful for reproducing
+ issues.
*/
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 71855c8c2..ee90a5810 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -119,6 +119,8 @@ QT_END_NAMESPACE
namespace QtWebEngineCore {
+Q_LOGGING_CATEGORY(webEngineContextLog, "qt.webenginecontext")
+
#if QT_CONFIG(opengl)
static bool usingSupportedSGBackend()
@@ -235,8 +237,7 @@ void dummyGetPluginCallback(const std::vector<content::WebPluginInfo>&)
static void logContext(const char *glType, base::CommandLine *cmd)
{
- QLoggingCategory webEngineContextLog("qt.webenginecontext");
- if (webEngineContextLog.isInfoEnabled()) {
+ if (Q_UNLIKELY(webEngineContextLog().isDebugEnabled())) {
#if QT_CONFIG(opengl)
const QSurfaceFormat sharedFormat = qt_gl_global_share_context()->format();
const auto profile = QMetaEnum::fromType<QSurfaceFormat::OpenGLContextProfile>().valueToKey(
@@ -248,23 +249,23 @@ static void logContext(const char *glType, base::CommandLine *cmd)
for (const auto &pair : switch_map)
params << " * " << toQt(pair.first)
<< toQt(pair.second) << "\n";
- qCInfo(webEngineContextLog,
- "\n\nGL Type: %s\n"
- "Surface Type: %s\n"
- "Surface Profile: %s\n"
- "Surface Version: %d.%d\n"
- "QSG RHI Backend: %s\n"
- "Using Supported QSG Backend: %s\n"
- "Using Software Dynamic GL: %s\n"
- "Using Multithreaded OpenGL: %s\n\n"
- "Init Parameters:\n %s",
- glType, type, profile, sharedFormat.majorVersion(), sharedFormat.minorVersion(),
- qUtf8Printable(QSGRhiSupport::instance()->rhiBackendName()),
- usingSupportedSGBackend() ? "yes" : "no", usingSoftwareDynamicGL() ? "yes" : "no",
- !WebEngineContext::isGpuServiceOnUIThread() ? "yes" : "no",
- qPrintable(params.join(" ")));
+ qCDebug(webEngineContextLog,
+ "\n\nGL Type: %s\n"
+ "Surface Type: %s\n"
+ "Surface Profile: %s\n"
+ "Surface Version: %d.%d\n"
+ "QSG RHI Backend: %s\n"
+ "Using Supported QSG Backend: %s\n"
+ "Using Software Dynamic GL: %s\n"
+ "Using Multithreaded OpenGL: %s\n\n"
+ "Init Parameters:\n %s",
+ glType, type, profile, sharedFormat.majorVersion(), sharedFormat.minorVersion(),
+ qUtf8Printable(QSGRhiSupport::instance()->rhiBackendName()),
+ usingSupportedSGBackend() ? "yes" : "no", usingSoftwareDynamicGL() ? "yes" : "no",
+ !WebEngineContext::isGpuServiceOnUIThread() ? "yes" : "no",
+ qPrintable(params.join(" ")));
#else
- qCInfo(webEngineContextLog) << "WebEngine compiled with no opengl enabled.";
+ qCDebug(webEngineContextLog) << "WebEngine compiled with no opengl enabled.";
#endif //QT_CONFIG(opengl)
}
}