summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/ozone/surface_factory_qt.cpp25
-rw-r--r--src/core/ozone/surface_factory_qt.h3
-rw-r--r--src/core/web_engine_context.cpp1
-rw-r--r--src/core/web_engine_context.h1
4 files changed, 12 insertions, 18 deletions
diff --git a/src/core/ozone/surface_factory_qt.cpp b/src/core/ozone/surface_factory_qt.cpp
index d2b2aab8a..03013de4d 100644
--- a/src/core/ozone/surface_factory_qt.cpp
+++ b/src/core/ozone/surface_factory_qt.cpp
@@ -58,31 +58,26 @@ namespace QtWebEngineCore {
SurfaceFactoryQt::SurfaceFactoryQt()
{
// Fixme: make better platform switch handling
- QString platform = qApp->platformName();
- if (platform == QLatin1String("xcb")) {
- m_impls.push_back(gl::kGLImplementationDesktopGL);
+ Q_ASSERT(qApp);
+ if (qApp->platformName() == QLatin1String("xcb")) {
+ m_impl = gl::kGLImplementationDesktopGL;
+#if QT_CONFIG(webengine_system_x11)
+ m_ozone.reset(new ui::GLOzoneGLXQt());
+#endif
} else {
- m_impls.push_back(gl::kGLImplementationEGLGLES2);
+ m_impl = gl::kGLImplementationEGLGLES2;
+ m_ozone.reset(new ui::GLOzoneEGLQt());
}
}
std::vector<gl::GLImplementation> SurfaceFactoryQt::GetAllowedGLImplementations()
{
- return m_impls;
+ return { m_impl };
}
ui::GLOzone* SurfaceFactoryQt::GetGLOzone(gl::GLImplementation implementation)
{
-
- QString platform = qApp->platformName();
- if (platform == QLatin1String("xcb")) {
-#if QT_CONFIG(webengine_system_x11)
- return new ui::GLOzoneGLXQt();
-#endif
- return nullptr;
- } else {
- return new ui::GLOzoneEGLQt();
- }
+ return m_ozone.get();
}
} // namespace QtWebEngineCore
diff --git a/src/core/ozone/surface_factory_qt.h b/src/core/ozone/surface_factory_qt.h
index 0ac2eca68..dee41d948 100644
--- a/src/core/ozone/surface_factory_qt.h
+++ b/src/core/ozone/surface_factory_qt.h
@@ -53,7 +53,8 @@ public:
std::vector<gl::GLImplementation> GetAllowedGLImplementations() override;
ui::GLOzone* GetGLOzone(gl::GLImplementation implementation) override;
private:
- std::vector<gl::GLImplementation> m_impls;
+ gl::GLImplementation m_impl;
+ std::unique_ptr<ui::GLOzone> m_ozone;
};
} // namespace QtWebEngineCore
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 7010359e2..6fbdbec61 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -96,7 +96,6 @@
#include "net/webui_controller_factory_qt.h"
#include "type_conversion.h"
#include "ozone/gl_context_qt.h"
-#include "ozone/surface_factory_qt.h"
#include "web_engine_library_info.h"
#include <QFileInfo>
diff --git a/src/core/web_engine_context.h b/src/core/web_engine_context.h
index e9e7c44a7..ce71984d4 100644
--- a/src/core/web_engine_context.h
+++ b/src/core/web_engine_context.h
@@ -67,7 +67,6 @@ namespace QtWebEngineCore {
class ProfileAdapter;
class ContentMainDelegateQt;
class DevToolsServerQt;
-class SurfaceFactoryQt;
bool usingSoftwareDynamicGL();