summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_context.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-04-18 14:42:00 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-04-18 14:42:00 +0200
commitee2b1e71a80f88de90a03e10a89ba491ef99d308 (patch)
treeb14cd541a3f7ad1fc6739e0f5a02d479334b6b34 /src/core/web_engine_context.cpp
parent61bdfb046700068afe36007ede3dcba1104099a3 (diff)
parent7db354d1a21a17da76244b77c35d7297be3a86a9 (diff)
Merge branch '5.6' into 5.7
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r--src/core/web_engine_context.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index bf7b29435..b3bfc432b 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -113,7 +113,9 @@ void destroyContext()
bool usingANGLE()
{
#if defined(Q_OS_WIN)
- return qt_gl_global_share_context()->isOpenGLES();
+ if (qt_gl_global_share_context())
+ return qt_gl_global_share_context()->isOpenGLES();
+ return QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES;
#else
return false;
#endif
@@ -296,10 +298,23 @@ WebEngineContext::WebEngineContext()
parsedCommandLine->AppendSwitch(switches::kDisableGpu);
} else {
const char *glType = 0;
- if (qt_gl_global_share_context()->isOpenGLES()) {
- glType = gfx::kGLImplementationEGLName;
+ if (qt_gl_global_share_context()) {
+ if (qt_gl_global_share_context()->isOpenGLES()) {
+ glType = gfx::kGLImplementationEGLName;
+ } else {
+ glType = gfx::kGLImplementationDesktopName;
+ }
} else {
- glType = gfx::kGLImplementationDesktopName;
+ qWarning("WebEngineContext used before QtWebEngine::initialize()");
+ // We have to assume the default OpenGL module type will be used.
+ switch (QOpenGLContext::openGLModuleType()) {
+ case QOpenGLContext::LibGL:
+ glType = gfx::kGLImplementationDesktopName;
+ break;
+ case QOpenGLContext::LibGLES:
+ glType = gfx::kGLImplementationEGLName;
+ break;
+ }
}
parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType);