summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_context.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2014-08-01 13:40:00 +0200
committerAndras Becsi <andras.becsi@digia.com>2014-09-25 19:47:07 +0200
commit41e5902e7799808fc71504d4222ee6363fec1aef (patch)
tree6bd63b04e2071bb7cee8156aaca9cd8b7eabea26 /src/core/web_engine_context.cpp
parentf3500da1ff1c7d383386c0197848262d7bedf90e (diff)
Add Desktop OpenGL backend for Windows
Enabling rendering into a WGL backbuffer, in addition to the EGL/angle one. Change-Id: I8f2e3f5ecf52b6db22712b1129059f462725a256 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r--src/core/web_engine_context.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 7c0a45b68..13daef5f6 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -75,6 +75,7 @@
#include "web_engine_library_info.h"
#include "web_engine_visited_links_manager.h"
#include <QGuiApplication>
+#include <QOpenGLContext>
#include <QStringList>
#include <QVector>
#include <qpa/qplatformnativeinterface.h>
@@ -170,10 +171,16 @@ 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->platformName() == QStringLiteral("eglfs"))
- && qApp->platformNativeInterface()->nativeResourceForWindow(QByteArrayLiteral("egldisplay"), 0))
- parsedCommandLine->AppendSwitchASCII(switches::kUseGL, gfx::kGLImplementationEGLName);
+ const char *glType;
+ switch (QOpenGLContext::currentContext()->openGLModuleType()) {
+ case QOpenGLContext::LibGL:
+ glType = gfx::kGLImplementationDesktopName;
+ break;
+ case QOpenGLContext::LibGLES:
+ glType = gfx::kGLImplementationEGLName;
+ break;
+ }
+ parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType);
content::UtilityProcessHostImpl::RegisterUtilityMainThreadFactory(content::CreateInProcessUtilityThread);
content::RenderProcessHostImpl::RegisterRendererMainThreadFactory(content::CreateInProcessRendererThread);