summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/web_engine_context.cpp11
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 {