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

Unified Diff: gpu/command_buffer/service/image_factory.h

Issue 962723002: Change CHROMIUM_image declarations to support multi planar input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reveman@ comments. 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: gpu/command_buffer/service/image_factory.h
diff --git a/gpu/command_buffer/service/image_factory.h b/gpu/command_buffer/service/image_factory.h
index b5813421945636813d2e72aecb775420bfa9953e..dac82215cb462531a2777161a7d143dfa410eada 100644
--- a/gpu/command_buffer/service/image_factory.h
+++ b/gpu/command_buffer/service/image_factory.h
@@ -21,19 +21,31 @@ class GPU_EXPORT ImageFactory {
public:
ImageFactory();
- // Returns a valid GpuMemoryBuffer format given a valid internalformat as
- // defined by CHROMIUM_gpu_memory_buffer_image.
+ // Returns true if |internalformat| is supported.
+ static bool IsImageFormatSupported(unsigned internalformat);
+
+ // Returns the number of GpuMemoryBuffers used for planes when given a valid
+ // |internalformat| as defined by CHROMIUM_gpu_memory_buffer_image.
+ static size_t NumberOfPlanesForImageFormat(unsigned internalformat);
+
+ // Returns a valid GpuMemoryBuffer format given a valid |internalformat| as
+ // defined by CHROMIUM_gpu_memory_buffer_image, and |plane| representing the
+ // zero-based index of the plane in a multiple planar format. If single
+ // planar, |plane| is expected to be 0.
static gfx::GpuMemoryBuffer::Format ImageFormatToGpuMemoryBufferFormat(
- unsigned internalformat);
+ unsigned internalformat, size_t plane);
// Returns a valid GpuMemoryBuffer usage given a valid usage as defined by
// CHROMIUM_gpu_memory_buffer_image.
static gfx::GpuMemoryBuffer::Usage ImageUsageToGpuMemoryBufferUsage(
unsigned usage);
- // Returns true if |internalformat| is compatible with |format|.
+ // Returns true if |internalformat| is compatible with |format| at position
+ // |plane| which is the zero-based index of the plane in a multiple planar
+ // format. If single planar, |plane| is expected to be 0.
static bool IsImageFormatCompatibleWithGpuMemoryBufferFormat(
unsigned internalformat,
+ size_t plane,
gfx::GpuMemoryBuffer::Format format);
// Returns true if |format| is supported by |capabilities|.
@@ -49,10 +61,10 @@ class GPU_EXPORT ImageFactory {
// Creates a GLImage instance for GPU memory buffer identified by |handle|.
// |client_id| should be set to the client requesting the creation of instance
// and can be used by factory implementation to verify access rights.
- virtual scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer(
- const gfx::GpuMemoryBufferHandle& handle,
+ virtual scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffers(
+ const std::vector<gfx::GpuMemoryBufferHandle>& handles,
const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format,
+ const std::vector<gfx::GpuMemoryBuffer::Format>& formats,
unsigned internalformat,
int client_id) = 0;

Powered by Google App Engine
This is Rietveld 408576698