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; |