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..16c8d7f9842d95044f4404cd7a0d161139469d4a 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,25 @@ GpuMemoryBufferImplOzoneNativePixmap::CreateFromHandle( | 
| gfx::BufferFormat format, | 
| gfx::BufferUsage usage, | 
| const DestructionCallback& callback) { | 
| + scoped_ptr<ui::ClientNativePixmap> native_pixmap = | 
| + ui::ClientNativePixmapFactory::GetInstance()->ImportFromHandle( | 
| + handle.native_pixmap_handle, size, format, usage); | 
| + DCHECK(native_pixmap); | 
| return make_scoped_ptr<GpuMemoryBufferImpl>( | 
| 
 
dcheng
2015/08/18 18:43:25
Note: not caused by this patch, but the idea of us
 
spang
2015/08/18 19:15:16
Done.
 
 | 
| 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() |