summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-07-14 11:04:36 +0200
committerMichal Klocek <michal.klocek@qt.io>2016-10-27 13:23:35 +0000
commitc4de6dafb00fdaf278d33798d709beb9fa7cfd78 (patch)
treeaa6de662ec1d53b0b752b5796f923f2ee88720e1
parent785ff563a73ecc67fdd83ec1e015bbb22570cabb (diff)
Disable GPU when no shared OpenGL context is available
In case an OpenGL context can not be created we can try running in software compositing mode. This should have a much better chance of working as a fallback. Change-Id: Icaab24dde8f4b6c8ea4023cf36b0bb679143166f Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
-rw-r--r--src/core/web_engine_context.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 3289a3c23..629490440 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -265,7 +265,7 @@ WebEngineContext::WebEngineContext()
const char *glType = 0;
if (!usingANGLE() && !usingSoftwareDynamicGL() && !usingQtQuick2DRenderer()) {
- if (qt_gl_global_share_context()) {
+ if (qt_gl_global_share_context() && qt_gl_global_share_context()->isValid()) {
if (!strcmp(qt_gl_global_share_context()->nativeHandle().typeName(), "QEGLNativeContext")) {
if (qt_gl_global_share_context()->isOpenGLES()) {
glType = gfx::kGLImplementationEGLName;
@@ -299,16 +299,7 @@ WebEngineContext::WebEngineContext()
glType = gfx::kGLImplementationDesktopName;
}
} else {
- 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;
- }
+ qWarning("WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.");
}
}