Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: ui/gfx/gpu_memory_buffer.h

Issue 1024113003: Add multi-planar functions to GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment and typo fix. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/gpu_memory_buffer.h
diff --git a/ui/gfx/gpu_memory_buffer.h b/ui/gfx/gpu_memory_buffer.h
index 3aa0964c36886233cb5ce7c474834abb51b60606..4792a20f8cf24e2ad67164685396da0cb56c4eac 100644
--- a/ui/gfx/gpu_memory_buffer.h
+++ b/ui/gfx/gpu_memory_buffer.h
@@ -61,11 +61,12 @@ class GFX_EXPORT GpuMemoryBuffer {
virtual ~GpuMemoryBuffer() {}
- // Maps the buffer into the client's address space so it can be 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 NULL
- // on failure.
- virtual void* Map() = 0;
+ // 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.
@@ -74,11 +75,16 @@ class GFX_EXPORT GpuMemoryBuffer {
// Returns true iff the buffer is mapped.
virtual bool IsMapped() const = 0;
+ // Returns the number of planes based on the format of the buffer.
+ virtual size_t GetNumberOfPlanes() const = 0;
reveman 2015/03/23 22:24:01 I still think it's better to not have this functio
emircan 2015/03/24 16:52:27 I see your point, but I don't see the case where i
reveman 2015/03/24 20:13:59 I think most of these DCHECKs are not needed. Eith
emircan 2015/03/24 21:43:44 Done. Thanks for the explanation.
+
// Returns the format for the buffer.
virtual Format GetFormat() const = 0;
- // Returns the stride in bytes for the buffer.
- virtual uint32 GetStride() const = 0;
+ // Fills the stride in bytes for the each plane of the buffer. The stride of
+ // plane K is stored at index K-1 of the |stride| array. Returns
+ // false on failure.
+ virtual bool GetStride(uint32* stride) const = 0;
reveman 2015/03/23 22:24:01 When would this fail? Please remove the return val
emircan 2015/03/24 16:52:27 GpuMemoryBufferImplSharedMemory::GetStride() calls
reveman 2015/03/24 20:13:59 GpuMemoryBufferImpl::StrideInBytes() having a retu
emircan 2015/03/24 21:43:44 Done.
// Returns a platform specific handle for this buffer.
virtual GpuMemoryBufferHandle GetHandle() const = 0;
« content/common/gpu/client/gpu_memory_buffer_impl.cc ('K') | « gpu/command_buffer/tests/gl_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698