path: root/src/core/web_engine_context.cpp
diff options
authorZeno Albisser <>2014-04-02 02:27:31 -0700
committerThe Qt Project <>2014-04-09 18:13:50 +0200
commit8e1a9c88431bbae3a47d09799395d81f76626ec0 (patch)
treed09be6d92354ac9afdc46d809f17fe617f9a66c4 /src/core/web_engine_context.cpp
parent6de87734c623d0b6ecfea0440ee396a00d59d74f (diff)
Add GLContextHelper class for EGL context creation.
Shared EGL contexts should always be created on the same thread, as otherwise context creation might fail. We use a GLContextHelper singleton that is initialized on startup and creates the contexts when requested through a BlockingQueuedConnection. There is a pretty and a correct solution for this problem. This is the pretty one. It is based on the assumption that Chromium decides to use the same or a similar enough configuration for the EGLContext as Qt previously did. But we prefer pretty over correct as the correct solution would potentially impose a layering violation. This is enabled for all embedded linux devices. Change-Id: I910cc90d0f87fd6d1fe0a475b17ba56cd8c503f6 Reviewed-by: Jocelyn Turcotte <>
Diffstat (limited to 'src/core/web_engine_context.cpp')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 7fd7e577d..b4e54aae1 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -68,6 +68,7 @@
#include "content_browser_client_qt.h"
#include "content_client_qt.h"
#include "content_main_delegate_qt.h"
+#include "gl_context_qt.h"
#include "type_conversion.h"
#include "web_engine_library_info.h"
#include <QGuiApplication>
@@ -152,6 +153,8 @@ WebEngineContext::WebEngineContext()
+ GLContextHelper::initialize();
// Tell Chromium to use EGL instead of GLX if the Qt xcb plugin also does.
if (qApp->platformName() == QStringLiteral("xcb") && qApp->platformNativeInterface()->nativeResourceForWindow(QByteArrayLiteral("egldisplay"), 0))
parsedCommandLine->AppendSwitchASCII(switches::kUseGL, gfx::kGLImplementationEGLName);