diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ozone/surface_factory_qt.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
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"); } } |