Chromium Code Reviews| Index: ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc |
| diff --git a/ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc b/ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc |
| index ca150e5d56c78d153ab489185dd7716d85758f91..34a941da3ed824f35ffc0ebaa78fb85b1cbab567 100644 |
| --- a/ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc |
| +++ b/ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc |
| @@ -5,12 +5,26 @@ |
| #include "ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.h" |
| #include "base/file_descriptor_posix.h" |
| +#include "ui/gfx/native_pixmap_handle_ozone.h" |
| #include "ui/ozone/public/client_native_pixmap_factory.h" |
| namespace ui { |
| namespace { |
| +class ClientNativePixmapGbm : public ClientNativePixmap { |
| + public: |
| + ClientNativePixmapGbm() {} |
| + ~ClientNativePixmapGbm() override {} |
| + |
| + bool Map(void** data) override { |
| + NOTREACHED(); |
| + return false; |
| + } |
| + void Unmap() override { NOTREACHED(); } |
| + void GetStride(int* stride) const override { NOTREACHED(); } |
| +}; |
| + |
| class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory { |
| public: |
| ClientNativePixmapFactoryGbm() {} |
| @@ -18,20 +32,20 @@ class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory { |
| // ClientNativePixmapFactory: |
| std::vector<Configuration> GetSupportedConfigurations() const override { |
| - const Configuration kConfiguratioins[] = { |
| + const Configuration kConfigurations[] = { |
| {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::SCANOUT}, |
| {gfx::BufferFormat::RGBX_8888, gfx::BufferUsage::SCANOUT}}; |
| std::vector<Configuration> configurations( |
| - kConfiguratioins, kConfiguratioins + arraysize(kConfiguratioins)); |
| + kConfigurations, kConfigurations + arraysize(kConfigurations)); |
| return configurations; |
| } |
| - scoped_ptr<ClientNativePixmap> ImportNativePixmap( |
| - const base::FileDescriptor& handle, |
| + scoped_ptr<ClientNativePixmap> ImportFromHandle( |
| + const gfx::NativePixmapHandle& handle, |
| const gfx::Size& size, |
| gfx::BufferFormat format, |
| gfx::BufferUsage usage) override { |
| - NOTIMPLEMENTED(); |
| - return nullptr; |
| + base::ScopedFD scoped_fd(handle.fd.fd); |
|
dcheng
2015/08/18 18:43:25
Is this getting invoked in response to an IPC?
ba
spang
2015/08/18 19:15:17
Right, we are required to take ownership. Putting
|
| + return make_scoped_ptr<ClientNativePixmapGbm>(new ClientNativePixmapGbm); |
|
dcheng
2015/08/18 18:43:26
Nit: make_scoped_ptr(new ClientNativePixmapGbm)
A
spang
2015/08/18 19:15:17
See the next patch for non-stub implementation: ht
|
| } |
| private: |