| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h" | 5 #include "gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "gpu/ipc/common/gpu_memory_buffer_support.h" | 9 #include "gpu/ipc/common/gpu_memory_buffer_support.h" |
| 10 #include "ui/gfx/buffer_format_util.h" | 10 #include "ui/gfx/buffer_format_util.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 int GpuMemoryBufferImplIOSurface::stride(size_t plane) const { | 111 int GpuMemoryBufferImplIOSurface::stride(size_t plane) const { |
| 112 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); | 112 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); |
| 113 return IOSurfaceGetBytesPerRowOfPlane(io_surface_, plane); | 113 return IOSurfaceGetBytesPerRowOfPlane(io_surface_, plane); |
| 114 } | 114 } |
| 115 | 115 |
| 116 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const { | 116 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const { |
| 117 gfx::GpuMemoryBufferHandle handle; | 117 gfx::GpuMemoryBufferHandle handle; |
| 118 handle.type = gfx::IO_SURFACE_BUFFER; | 118 handle.type = gfx::IO_SURFACE_BUFFER; |
| 119 handle.id = id_; | 119 handle.id = id_; |
| 120 handle.mach_port.reset(IOSurfaceCreateMachPort(io_surface_)); |
| 120 return handle; | 121 return handle; |
| 121 } | 122 } |
| 122 | 123 |
| 123 } // namespace gpu | 124 } // namespace gpu |
| OLD | NEW |