Chromium Code Reviews| Index: content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc |
| diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc |
| index 7acf59c8e51527215405b8ee7a18c12c2f90160c..40500a604f8a10ed40790cccb67a61348d455023 100644 |
| --- a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc |
| +++ b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc |
| @@ -4,6 +4,7 @@ |
| #include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.h" |
| +#include "ui/ozone/public/client_native_pixmap_factory.h" |
| #include "ui/ozone/public/surface_factory_ozone.h" |
| namespace content { |
| @@ -12,8 +13,9 @@ GpuMemoryBufferImplOzoneNativePixmap::GpuMemoryBufferImplOzoneNativePixmap( |
| gfx::GpuMemoryBufferId id, |
| const gfx::Size& size, |
| gfx::BufferFormat format, |
| - const DestructionCallback& callback) |
| - : GpuMemoryBufferImpl(id, size, format, callback) {} |
| + const DestructionCallback& callback, |
| + scoped_ptr<ui::ClientNativePixmap> pixmap) |
| + : GpuMemoryBufferImpl(id, size, format, callback), pixmap_(pixmap.Pass()) {} |
| GpuMemoryBufferImplOzoneNativePixmap::~GpuMemoryBufferImplOzoneNativePixmap() {} |
| @@ -25,22 +27,24 @@ GpuMemoryBufferImplOzoneNativePixmap::CreateFromHandle( |
| gfx::BufferFormat format, |
| gfx::BufferUsage usage, |
| const DestructionCallback& callback) { |
| + scoped_ptr<ui::ClientNativePixmap> native_pixmap = |
| + ui::ClientNativePixmapFactory::GetInstance()->ImportFromHandle( |
|
no sievers
2015/08/11 21:16:33
Can this fail?
Below we are accessing |pixmap_| w
spang
2015/08/11 22:03:31
Done. However since cc does not check for allocati
reveman
2015/08/12 08:20:29
cc handles GMB allocation failure properly as it c
dshwang
2015/08/12 08:28:09
I think null check is not needed, as well as nullp
dshwang
2015/08/12 08:41:43
I understand that ClientNativePixmapGbm is always
|
| + handle.native_pixmap_handle, size, format, usage); |
| return make_scoped_ptr<GpuMemoryBufferImpl>( |
| new GpuMemoryBufferImplOzoneNativePixmap(handle.id, size, format, |
| - callback)); |
| + callback, native_pixmap.Pass())); |
| } |
| bool GpuMemoryBufferImplOzoneNativePixmap::Map(void** data) { |
| - NOTREACHED(); |
| - return false; |
| + return pixmap_->Map(data); |
| } |
| void GpuMemoryBufferImplOzoneNativePixmap::Unmap() { |
| - NOTREACHED(); |
| + pixmap_->Unmap(); |
| } |
| void GpuMemoryBufferImplOzoneNativePixmap::GetStride(int* stride) const { |
| - NOTREACHED(); |
| + pixmap_->GetStride(stride); |
| } |
| gfx::GpuMemoryBufferHandle GpuMemoryBufferImplOzoneNativePixmap::GetHandle() |