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

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl.h

Issue 1062853002: Add gfx::GpuMemoryBuffer::YUV_420 and GpuMemoryBufferImplSharedMemory support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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: content/common/gpu/client/gpu_memory_buffer_impl.h
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl.h b/content/common/gpu/client/gpu_memory_buffer_impl.h
index cd8c108f571a5aaa6709ac5e718a04ec5d9708cf..b1888e631a3e5abeb5855c50a98aadeaceb31baa 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl.h
+++ b/content/common/gpu/client/gpu_memory_buffer_impl.h
@@ -33,15 +33,27 @@ class CONTENT_EXPORT GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
// Type-checking upcast routine. Returns an NULL on failure.
static GpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer);
+ // Returns the number of planes based on the format of the buffer.
+ static size_t NumberOfPlanesForGpuMemoryBufferFormat(
+ gfx::GpuMemoryBuffer::Format format);
+
// Calculates the number of bytes that an implementation must use to store
// one row of pixel data.
static bool StrideInBytes(size_t width,
Format format,
+ int plane,
size_t* stride_in_bytes);
- // Returns the number of planes based on the format of the buffer.
- static size_t NumberOfPlanesForGpuMemoryBufferFormat(
- gfx::GpuMemoryBuffer::Format format);
+ // Returns the subsampling factor applied to the given zero-indexed |plane| of
+ // the |format| both horizontally and vertically.
+ static size_t SubsamplingFactor(gfx::GpuMemoryBuffer::Format format,
+ int plane);
+
+ // Calculates the number of bytes that an implementation must use to store
+ // all the planes of a given |format|.
+ static bool TotalBufferSizeInBytes(const gfx::Size& size,
reveman 2015/04/07 19:03:25 nit: not sure you need the "Total" prefix, BufferS
emircan 2015/04/07 20:08:12 Done.
+ gfx::GpuMemoryBuffer::Format format,
+ size_t* total_size_in_bytes);
reveman 2015/04/07 19:03:25 remove "total_" prefix here too if you decide to r
emircan 2015/04/07 20:08:12 Done.
// Overridden from gfx::GpuMemoryBuffer:
bool IsMapped() const override;

Powered by Google App Engine
This is Rietveld 408576698