From 7bb9e274bc017e87226145ea7159679d4b46f47e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 10 Oct 2018 16:50:55 +0200 Subject: Fix Ozone platform detection Only use GLX if GLX is used as OpenGL backend. This fixes using QtWebEngine on Linux with QT_XCB_GL_INTEGRATION=xcb_egl set, or when it automatically falls back to EGL. Change-Id: Ida95e4148e72af0d64fe16285b5007e3105ad898 Reviewed-by: Michal Klocek --- src/core/ozone/surface_factory_qt.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/core') diff --git a/src/core/ozone/surface_factory_qt.cpp b/src/core/ozone/surface_factory_qt.cpp index 03013de4d..3ceebeec1 100644 --- a/src/core/ozone/surface_factory_qt.cpp +++ b/src/core/ozone/surface_factory_qt.cpp @@ -39,8 +39,8 @@ #include "surface_factory_qt.h" #include "qtwebenginecoreglobal_p.h" +#include "gl_context_qt.h" #include "gl_ozone_egl_qt.h" - #if QT_CONFIG(webengine_system_x11) #include "gl_ozone_glx_qt.h" #endif @@ -57,16 +57,18 @@ namespace QtWebEngineCore { SurfaceFactoryQt::SurfaceFactoryQt() { - // Fixme: make better platform switch handling Q_ASSERT(qApp); - if (qApp->platformName() == QLatin1String("xcb")) { - m_impl = gl::kGLImplementationDesktopGL; #if QT_CONFIG(webengine_system_x11) + if (GLContextHelper::getXConfig()) { + m_impl = gl::kGLImplementationDesktopGL; m_ozone.reset(new ui::GLOzoneGLXQt()); + } else #endif - } else { + if (GLContextHelper::getEGLConfig()) { m_impl = gl::kGLImplementationEGLGLES2; m_ozone.reset(new ui::GLOzoneEGLQt()); + } else { + qFatal("No suitable graphics backend found\n"); } } -- cgit v1.2.3