diff options
author | Siteshwar Vashisht <siteshwar@gmail.com> | 2015-12-18 16:45:59 +0530 |
---|---|---|
committer | Siteshwar Vashisht <siteshwar@gmail.com> | 2015-12-21 08:18:20 +0000 |
commit | 382a9de3ee83ef59f6f95cb5b478df84cbbd80b8 (patch) | |
tree | 13cc93d71b77d378d3d52a829c741ab5a7194934 /src/core/web_engine_context.cpp | |
parent | 8d2c46216fcb521c3e7a13cb627239db088a50c4 (diff) |
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 <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r-- | src/core/web_engine_context.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
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<WebEngineContext> 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); } |