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 e7ebdcff57c14d1fabe62f9c697b0c52cecb499c..f1e212025c546a70cdad4ae95c106cbb5ffe7c5d 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 |
| @@ -29,19 +29,22 @@ GpuMemoryBufferImplOzoneNativePixmap::CreateFromHandle( |
| const DestructionCallback& callback) { |
| scoped_ptr<ui::ClientNativePixmap> native_pixmap = |
| ui::ClientNativePixmapFactory::GetInstance()->ImportFromHandle( |
| - handle.native_pixmap_handle, size, format, usage); |
| + handle.native_pixmap_handle, size, usage); |
| DCHECK(native_pixmap); |
| - return make_scoped_ptr( |
| - new GpuMemoryBufferImplOzoneNativePixmap(handle.id, size, format, |
| - callback, native_pixmap.Pass())); |
| + return make_scoped_ptr(new GpuMemoryBufferImplOzoneNativePixmap( |
| + handle.id, size, format, callback, native_pixmap.Pass())); |
| } |
| bool GpuMemoryBufferImplOzoneNativePixmap::Map(void** data) { |
| - return pixmap_->Map(data); |
| + *data = pixmap_->Map(); |
| + mapped_ = !!(*data); |
|
reveman
2015/08/19 13:18:11
nit: mapped_ = true; and remove the DCHECK below a
dshwang
2015/08/19 13:23:20
Done.
|
| + DCHECK(mapped_); |
| + return mapped_; |
| } |
| void GpuMemoryBufferImplOzoneNativePixmap::Unmap() { |
| pixmap_->Unmap(); |
| + mapped_ = false; |
| } |
| void GpuMemoryBufferImplOzoneNativePixmap::GetStride(int* stride) const { |