| Index: ui/gfx/gpu_memory_buffer.h
|
| diff --git a/ui/gfx/gpu_memory_buffer.h b/ui/gfx/gpu_memory_buffer.h
|
| index 629dabc693d4b1700b28fad548ffc9314a71ad48..72ff1d26704eeed8cb9e9a4b4bcd68be897b0d5a 100644
|
| --- a/ui/gfx/gpu_memory_buffer.h
|
| +++ b/ui/gfx/gpu_memory_buffer.h
|
| @@ -30,7 +30,7 @@ enum GpuMemoryBufferType {
|
| GPU_MEMORY_BUFFER_TYPE_LAST = OZONE_NATIVE_PIXMAP
|
| };
|
|
|
| -using GpuMemoryBufferId = gfx::GenericSharedMemoryId;
|
| +using GpuMemoryBufferId = GenericSharedMemoryId;
|
|
|
| struct GFX_EXPORT GpuMemoryBufferHandle {
|
| GpuMemoryBufferHandle();
|
| @@ -55,25 +55,28 @@ class GFX_EXPORT GpuMemoryBuffer {
|
| virtual ~GpuMemoryBuffer() {}
|
|
|
| // Maps each plane of the buffer into the client's address space so it can be
|
| - // written to by the CPU. A pointer to plane K is stored at index K-1 of the
|
| - // |data| array. This call may block, for instance if the GPU needs to finish
|
| - // accessing the buffer or if CPU caches need to be synchronized. Returns
|
| - // false on failure.
|
| - virtual bool Map(void** data) = 0;
|
| -
|
| - // Unmaps the buffer. It's illegal to use the pointer returned by Map() after
|
| - // this has been called.
|
| + // written to by the CPU. This call may block, for instance if the GPU needs
|
| + // to finish accessing the buffer or if CPU caches need to be synchronized.
|
| + // Returns false on failure.
|
| + virtual bool Map() = 0;
|
| +
|
| + // Returns a pointer to the memory address of a plane. Buffer must have been
|
| + // successfully mapped using a call to Map() before calling this function.
|
| + virtual void* memory(size_t plane) = 0;
|
| +
|
| + // Unmaps the buffer. It's illegal to use any pointer returned by memory()
|
| + // after this has been called.
|
| virtual void Unmap() = 0;
|
|
|
| // Returns the size for the buffer.
|
| - virtual gfx::Size GetSize() const = 0;
|
| + virtual Size GetSize() const = 0;
|
|
|
| // Returns the format for the buffer.
|
| virtual BufferFormat GetFormat() const = 0;
|
|
|
| // Fills the stride in bytes for each plane of the buffer. The stride of
|
| // plane K is stored at index K-1 of the |stride| array.
|
| - virtual void GetStride(int* stride) const = 0;
|
| + virtual int stride(size_t plane) const = 0;
|
|
|
| // Returns a unique identifier associated with buffer.
|
| virtual GpuMemoryBufferId GetId() const = 0;
|
|
|