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

Unified Diff: ui/ozone/platform/drm/gpu/gbm_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
Index: ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
diff --git a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
index 6abf013d58bc18d724deb285ce1acfaa5816cad6..59b1bb54ff2b0c57b86364039d47e40a90334751 100644
--- a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
@@ -17,6 +17,7 @@
#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/drm/common/drm_util.h"
#include "ui/ozone/platform/drm/gpu/drm_thread_proxy.h"
#include "ui/ozone/platform/drm/gpu/drm_window_proxy.h"
@@ -75,7 +76,9 @@ class GLOzoneEGLGbm : public GLOzoneEGL {
} // namespace
GbmSurfaceFactory::GbmSurfaceFactory(DrmThreadProxy* drm_thread_proxy)
- : egl_implementation_(new GLOzoneEGLGbm(this, drm_thread_proxy)),
+ : egl_implementation_(
+ base::MakeUnique<GLOzoneEGLGbm>(this, drm_thread_proxy)),
+ osmesa_implementation_(base::MakeUnique<GLOzoneOSMesa>()),
drm_thread_proxy_(drm_thread_proxy) {}
GbmSurfaceFactory::~GbmSurfaceFactory() {
@@ -104,10 +107,8 @@ GbmSurfaceless* GbmSurfaceFactory::GetSurface(
std::vector<gl::GLImplementation>
GbmSurfaceFactory::GetAllowedGLImplementations() {
DCHECK(thread_checker_.CalledOnValidThread());
- std::vector<gl::GLImplementation> impls;
- impls.push_back(gl::kGLImplementationEGLGLES2);
- impls.push_back(gl::kGLImplementationOSMesaGL);
- return impls;
+ return std::vector<gl::GLImplementation>{gl::kGLImplementationEGLGLES2,
+ gl::kGLImplementationOSMesaGL};
}
GLOzone* GbmSurfaceFactory::GetGLOzone(gl::GLImplementation implementation) {
@@ -115,6 +116,8 @@ GLOzone* GbmSurfaceFactory::GetGLOzone(gl::GLImplementation implementation) {
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/drm/gpu/gbm_surface_factory.h ('k') | ui/ozone/platform/headless/headless_surface_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698