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

Unified Diff: ui/ozone/platform/cast/surface_factory_cast.cc

Issue 2731733002: Convert Ozone GL OSMesa implementation. (Closed)
Patch Set: Cleanup. 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/cast/surface_factory_cast.cc
diff --git a/ui/ozone/platform/cast/surface_factory_cast.cc b/ui/ozone/platform/cast/surface_factory_cast.cc
index 5d12590852b9194f1d6da8df5ba37ef1311798ef..6128f5f0b2793c17534cd81f501d8829b181ec4e 100644
--- a/ui/ozone/platform/cast/surface_factory_cast.cc
+++ b/ui/ozone/platform/cast/surface_factory_cast.cc
@@ -12,6 +12,7 @@
#include "third_party/skia/include/core/SkSurface.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/vsync_provider.h"
+#include "ui/ozone/common/gl_ozone_osmesa.h"
#include "ui/ozone/public/native_pixmap.h"
#include "ui/ozone/public/surface_ozone_canvas.h"
@@ -87,12 +88,16 @@ class CastPixmap : public NativePixmap {
} // namespace
-SurfaceFactoryCast::SurfaceFactoryCast() {}
+SurfaceFactoryCast::SurfaceFactoryCast() : SurfaceFactoryCast(nullptr) {}
SurfaceFactoryCast::SurfaceFactoryCast(
std::unique_ptr<chromecast::CastEglPlatform> egl_platform)
- : egl_implementation_(
- base::MakeUnique<GLOzoneEglCast>(std::move(egl_platform))) {}
+ : osmesa_implementation_(base::MakeUnique<GLOzoneOSMesa>()) {
+ if (egl_platform) {
+ egl_implementation_ =
+ base::MakeUnique<GLOzoneEglCast>(std::move(egl_platform));
+ }
+}
SurfaceFactoryCast::~SurfaceFactoryCast() {}
@@ -109,6 +114,8 @@ GLOzone* SurfaceFactoryCast::GetGLOzone(gl::GLImplementation implementation) {
switch (implementation) {
case gl::kGLImplementationEGLGLES2:
return egl_implementation_.get();
+ case gl::kGLImplementationOSMesaGL:
+ return osmesa_implementation_.get();
default:
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698