Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Unified Diff: ui/ozone/platform/wayland/wayland_surface_factory.cc

Issue 2731733002: Convert Ozone GL OSMesa implementation. (Closed)
Patch Set: Fix rebase. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/wayland/wayland_surface_factory.h ('k') | ui/ozone/platform/x11/x11_surface_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/wayland/wayland_surface_factory.cc
diff --git a/ui/ozone/platform/wayland/wayland_surface_factory.cc b/ui/ozone/platform/wayland/wayland_surface_factory.cc
index 46752c98114e533a392dfae7098438b4b79615ec..b5f365b4e03e8a6106492c892a2654bcf101029a 100644
--- a/ui/ozone/platform/wayland/wayland_surface_factory.cc
+++ b/ui/ozone/platform/wayland/wayland_surface_factory.cc
@@ -14,6 +14,7 @@
#include "ui/gfx/vsync_provider.h"
#include "ui/ozone/common/egl_util.h"
#include "ui/ozone/common/gl_ozone_egl.h"
+#include "ui/ozone/common/gl_ozone_osmesa.h"
#include "ui/ozone/platform/wayland/gl_surface_wayland.h"
#include "ui/ozone/platform/wayland/wayland_connection.h"
#include "ui/ozone/platform/wayland/wayland_object.h"
@@ -128,7 +129,8 @@ namespace {
class GLOzoneEGLWayland : public GLOzoneEGL {
public:
- GLOzoneEGLWayland(WaylandConnection* connection) : connection_(connection) {}
+ explicit GLOzoneEGLWayland(WaylandConnection* connection)
+ : connection_(connection) {}
~GLOzoneEGLWayland() override {}
scoped_refptr<gl::GLSurface> CreateViewGLSurface(
@@ -182,9 +184,10 @@ bool GLOzoneEGLWayland::LoadGLES2Bindings() {
} // namespace
WaylandSurfaceFactory::WaylandSurfaceFactory(WaylandConnection* connection)
- : connection_(connection) {
+ : connection_(connection),
+ osmesa_implementation_(base::MakeUnique<GLOzoneOSMesa>()) {
if (connection_)
- egl_implementation_.reset(new GLOzoneEGLWayland(connection_));
+ egl_implementation_ = base::MakeUnique<GLOzoneEGLWayland>(connection_);
}
WaylandSurfaceFactory::~WaylandSurfaceFactory() {}
@@ -201,7 +204,9 @@ WaylandSurfaceFactory::CreateCanvasForWidget(gfx::AcceleratedWidget widget) {
std::vector<gl::GLImplementation>
WaylandSurfaceFactory::GetAllowedGLImplementations() {
std::vector<gl::GLImplementation> impls;
- impls.push_back(gl::kGLImplementationEGLGLES2);
+ if (egl_implementation_)
+ impls.push_back(gl::kGLImplementationEGLGLES2);
+ impls.push_back(gl::kGLImplementationOSMesaGL);
return impls;
}
@@ -210,6 +215,8 @@ GLOzone* WaylandSurfaceFactory::GetGLOzone(
switch (implementation) {
case gl::kGLImplementationEGLGLES2:
return egl_implementation_.get();
+ case gl::kGLImplementationOSMesaGL:
+ return osmesa_implementation_.get();
default:
return nullptr;
}
« no previous file with comments | « ui/ozone/platform/wayland/wayland_surface_factory.h ('k') | ui/ozone/platform/x11/x11_surface_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698