| Index: ui/ozone/platform/headless/headless_surface_factory.cc
|
| diff --git a/ui/ozone/platform/headless/headless_surface_factory.cc b/ui/ozone/platform/headless/headless_surface_factory.cc
|
| index 6b63cc630d935539fbe1ff320379fcab9e4b57f4..b83fc7a428c15abe9ad3f3043e28e846aea843bf 100644
|
| --- a/ui/ozone/platform/headless/headless_surface_factory.cc
|
| +++ b/ui/ozone/platform/headless/headless_surface_factory.cc
|
| @@ -15,6 +15,7 @@
|
| #include "ui/gfx/codec/png_codec.h"
|
| #include "ui/gfx/skia_util.h"
|
| #include "ui/gfx/vsync_provider.h"
|
| +#include "ui/ozone/common/gl_ozone_osmesa.h"
|
| #include "ui/ozone/platform/headless/headless_window.h"
|
| #include "ui/ozone/platform/headless/headless_window_manager.h"
|
| #include "ui/ozone/public/native_pixmap.h"
|
| @@ -111,10 +112,26 @@ HeadlessSurfaceFactory::HeadlessSurfaceFactory()
|
|
|
| HeadlessSurfaceFactory::HeadlessSurfaceFactory(
|
| HeadlessWindowManager* window_manager)
|
| - : window_manager_(window_manager) {}
|
| + : window_manager_(window_manager),
|
| + osmesa_implementation_(base::MakeUnique<GLOzoneOSMesa>()) {}
|
|
|
| HeadlessSurfaceFactory::~HeadlessSurfaceFactory() {}
|
|
|
| +std::vector<gl::GLImplementation>
|
| +HeadlessSurfaceFactory::GetAllowedGLImplementations() {
|
| + return std::vector<gl::GLImplementation>{gl::kGLImplementationOSMesaGL};
|
| +}
|
| +
|
| +GLOzone* HeadlessSurfaceFactory::GetGLOzone(
|
| + gl::GLImplementation implementation) {
|
| + switch (implementation) {
|
| + case gl::kGLImplementationOSMesaGL:
|
| + return osmesa_implementation_.get();
|
| + default:
|
| + return nullptr;
|
| + }
|
| +}
|
| +
|
| std::unique_ptr<SurfaceOzoneCanvas>
|
| HeadlessSurfaceFactory::CreateCanvasForWidget(gfx::AcceleratedWidget widget) {
|
| HeadlessWindow* window = window_manager_->GetWindow(widget);
|
|
|