diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-10-11 13:56:31 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-10-12 05:39:52 +0000 |
commit | f4815cebae99bc27f6880e3281eda81078821d08 (patch) | |
tree | cf0c6fc8293dfa45e17e15df33454ced3607d1de /src | |
parent | fe8ae4b78065916e1882aaedc5994d66a8456df4 (diff) |
Fix crash in WebEngineContext when using Wayland
For some reason the OpenGL context wayland QPA sets has no nativeHandle,
so we end up crashing in strcmp.
Assume a context without nativeHandle is Wayland or other GLES2 platform
and also force GLES2 when using Ozone.
Change-Id: Ia3fc524f3ffbb278d86f9153ec96c7258ef86656
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/web_engine_context.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 7d1e5d609..ceb14f843 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -311,8 +311,15 @@ WebEngineContext::WebEngineContext() const char *glType = 0; if (!usingANGLE() && !usingSoftwareDynamicGL() && !usingQtQuick2DRenderer()) { - if (qt_gl_global_share_context()) { - if (!strcmp(qt_gl_global_share_context()->nativeHandle().typeName(), "QEGLNativeContext")) { + if (qt_gl_global_share_context() && qt_gl_global_share_context()->isValid()) { + // If the native handle is QEGLNativeContext try to use GL ES/2, if there is no native handle + // assume we are using wayland and try GL ES/2, and finally Ozone demands GL ES/2 too. + if (qt_gl_global_share_context()->nativeHandle().isNull() +#ifdef USE_OZONE + || true +#endif + || !strcmp(qt_gl_global_share_context()->nativeHandle().typeName(), "QEGLNativeContext")) + { if (qt_gl_global_share_context()->isOpenGLES()) { glType = gfx::kGLImplementationEGLName; } else { |