| Index: content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc
|
| diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc b/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc
|
| index f16125bfa181f8e5bd51abfe54c0d48b3d453511..4cf13dcc65964f07c78c3ae1a5fdd9a16c9a81ff 100644
|
| --- a/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc
|
| +++ b/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc
|
| @@ -61,7 +61,14 @@ bool GpuMemoryBufferImplIOSurface::Map(void** data) {
|
| IOReturn status = IOSurfaceLock(io_surface_, lock_flags_, NULL);
|
| DCHECK_NE(status, kIOReturnCannotLock);
|
| mapped_ = true;
|
| - *data = IOSurfaceGetBaseAddress(io_surface_);
|
| +
|
| + const size_t planes = IOSurfaceGetPlaneCount(io_surface_);
|
| + if (planes == 0) {
|
| + data[0] = IOSurfaceGetBaseAddress(io_surface_);
|
| + } else {
|
| + for (size_t plane = 0; plane < planes; ++plane)
|
| + data[plane] = IOSurfaceGetBaseAddressOfPlane(io_surface_, plane);
|
| + }
|
| return true;
|
| }
|
|
|
| @@ -71,8 +78,14 @@ void GpuMemoryBufferImplIOSurface::Unmap() {
|
| mapped_ = false;
|
| }
|
|
|
| -void GpuMemoryBufferImplIOSurface::GetStride(int* stride) const {
|
| - *stride = IOSurfaceGetBytesPerRow(io_surface_);
|
| +void GpuMemoryBufferImplIOSurface::GetStride(int* strides) const {
|
| + const size_t planes = IOSurfaceGetPlaneCount(io_surface_);
|
| + if (planes == 0) {
|
| + strides[0] = IOSurfaceGetBytesPerRow(io_surface_);
|
| + } else {
|
| + for (size_t plane = 0; plane < planes; ++plane)
|
| + strides[plane] = IOSurfaceGetBytesPerRowOfPlane(io_surface_, plane);
|
| + }
|
| }
|
|
|
| gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const {
|
|
|