summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-10-10 16:50:55 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-10-11 23:23:36 +0000
commit7bb9e274bc017e87226145ea7159679d4b46f47e (patch)
tree1fe623b5a79d53faf08c45165105d0db0679e1b7
parent3da3568a2543e9081e5248b22a99abdddb1a791a (diff)
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 <michal.klocek@qt.io>
-rw-r--r--src/core/ozone/surface_factory_qt.cpp12
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");
}
}