From 382a9de3ee83ef59f6f95cb5b478df84cbbd80b8 Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Fri, 18 Dec 2015 16:45:59 +0530 Subject: Use QOpenGLContext::isOpenGLES() to check if OpenGL ES is enabled QOpenGLContext::openGLModuleType() performs a general check whether OpenGL ES support is enabled or not. However it is possible that a specific OpenGL context does not have OpenGL ES support enabled even when QOpenGLContext::openGLModuleType() returns QOpenGLContext::LibGLES. In such situations QOpenGLContext::isOpenGLES() method is correct way to determine if the context is an OpenGL ES context. Task-number: QTBUG-50015 Change-Id: I319c2932a62027d3142040045a46cdcb12fcdebe Reviewed-by: Allan Sandfeld Jensen --- src/core/web_engine_context.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 12b8bdadb..9c8a6c757 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -85,6 +85,10 @@ using namespace QtWebEngineCore; +QT_BEGIN_NAMESPACE +Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); +QT_END_NAMESPACE + namespace { scoped_refptr sContext; @@ -101,7 +105,7 @@ void destroyContext() bool usingANGLE() { #if defined(Q_OS_WIN) - return QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES; + return qt_gl_global_share_context()->isOpenGLES(); #else return false; #endif @@ -239,14 +243,12 @@ WebEngineContext::WebEngineContext() parsedCommandLine->AppendSwitch(switches::kDisableGpu); } else { const char *glType = 0; - switch (QOpenGLContext::openGLModuleType()) { - case QOpenGLContext::LibGL: - glType = gfx::kGLImplementationDesktopName; - break; - case QOpenGLContext::LibGLES: + if (qt_gl_global_share_context()->isOpenGLES()) { glType = gfx::kGLImplementationEGLName; - break; + } else { + glType = gfx::kGLImplementationDesktopName; } + parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType); } -- cgit v1.2.3