Index: gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc |
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc b/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc |
index 86855a8a3ddefd95d8dcb09454d3c0e1219f03e3..8e84b7dd73f390fdea7146d372545f78c0fcad41 100644 |
--- a/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc |
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc |
@@ -35,8 +35,7 @@ GpuMemoryBufferImplOzoneNativePixmap::GpuMemoryBufferImplOzoneNativePixmap( |
: GpuMemoryBufferImpl(id, size, format, callback), |
pixmap_(std::move(pixmap)), |
planes_(planes), |
- fd_(std::move(fd)), |
- data_(nullptr) {} |
+ fd_(std::move(fd)) {} |
GpuMemoryBufferImplOzoneNativePixmap::~GpuMemoryBufferImplOzoneNativePixmap() {} |
@@ -101,33 +100,24 @@ base::Closure GpuMemoryBufferImplOzoneNativePixmap::AllocateForTesting( |
bool GpuMemoryBufferImplOzoneNativePixmap::Map() { |
DCHECK(!mapped_); |
- DCHECK(!data_); |
- data_ = pixmap_->Map(); |
- if (!data_) |
- return false; |
- mapped_ = true; |
+ mapped_ = pixmap_->Map(); |
return mapped_; |
} |
void* GpuMemoryBufferImplOzoneNativePixmap::memory(size_t plane) { |
DCHECK(mapped_); |
- DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); |
- return data_; |
+ return pixmap_->GetMemoryAddress(plane); |
} |
void GpuMemoryBufferImplOzoneNativePixmap::Unmap() { |
DCHECK(mapped_); |
- DCHECK(data_); |
pixmap_->Unmap(); |
mapped_ = false; |
- data_ = nullptr; |
} |
int GpuMemoryBufferImplOzoneNativePixmap::stride(size_t plane) const { |
DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); |
- int stride; |
- pixmap_->GetStride(&stride); |
- return stride; |
+ return pixmap_->GetStride(plane); |
} |
gfx::GpuMemoryBufferHandle GpuMemoryBufferImplOzoneNativePixmap::GetHandle() |