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

Unified Diff: ui/ozone/platform/x11/x11_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/x11/x11_surface_factory.h ('k') | ui/ozone/public/surface_factory_ozone.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/x11/x11_surface_factory.cc
diff --git a/ui/ozone/platform/x11/x11_surface_factory.cc b/ui/ozone/platform/x11/x11_surface_factory.cc
index bb92d7eba3b4317b6aacffeb78eca828ec7a7843..27570cc9b66b4f47db1ff3e73257e6d0bfda5075 100644
--- a/ui/ozone/platform/x11/x11_surface_factory.cc
+++ b/ui/ozone/platform/x11/x11_surface_factory.cc
@@ -6,12 +6,14 @@
#include <X11/Xlib.h>
+#include "base/memory/ptr_util.h"
#include "third_party/khronos/EGL/egl.h"
#include "ui/gfx/x/x11_types.h"
#include "ui/gl/egl_util.h"
#include "ui/gl/gl_surface_egl.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/x11/gl_ozone_glx.h"
namespace ui {
@@ -149,21 +151,19 @@ class GLOzoneEGLX11 : public GLOzoneEGL {
} // namespace
-X11SurfaceFactory::X11SurfaceFactory() {
- glx_implementation_.reset(new GLOzoneGLX());
- egl_implementation_.reset(new GLOzoneEGLX11());
-}
+X11SurfaceFactory::X11SurfaceFactory()
+ : glx_implementation_(base::MakeUnique<GLOzoneGLX>()),
+ egl_implementation_(base::MakeUnique<GLOzoneEGLX11>()),
+ osmesa_implementation_(base::MakeUnique<GLOzoneOSMesa>()) {}
X11SurfaceFactory::~X11SurfaceFactory() {}
std::vector<gl::GLImplementation>
X11SurfaceFactory::GetAllowedGLImplementations() {
- std::vector<gl::GLImplementation> impls;
- impls.push_back(gl::kGLImplementationEGLGLES2);
// DesktopGL (GLX) should be the first option when crbug.com/646982 is fixed.
- impls.push_back(gl::kGLImplementationDesktopGL);
- impls.push_back(gl::kGLImplementationOSMesaGL);
- return impls;
+ return std::vector<gl::GLImplementation>{gl::kGLImplementationEGLGLES2,
+ gl::kGLImplementationDesktopGL,
+ gl::kGLImplementationOSMesaGL};
}
GLOzone* X11SurfaceFactory::GetGLOzone(gl::GLImplementation implementation) {
@@ -172,6 +172,8 @@ GLOzone* X11SurfaceFactory::GetGLOzone(gl::GLImplementation implementation) {
return glx_implementation_.get();
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/x11/x11_surface_factory.h ('k') | ui/ozone/public/surface_factory_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698