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( |
+ 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() |