From c4de6dafb00fdaf278d33798d709beb9fa7cfd78 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 14 Jul 2016 11:04:36 +0200 Subject: Disable GPU when no shared OpenGL context is available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/core/web_engine_context.cpp | 13 ++----------- 1 file 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."); } } -- cgit v1.2.3