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 bea7f185874e47228e02c6506740064b701058ff..63088fe548dbe37508642a17b3b2922c2b9452d1 100644 |
--- a/content/common/gpu/client/gpu_memory_buffer_impl.h |
+++ b/content/common/gpu/client/gpu_memory_buffer_impl.h |
@@ -23,11 +23,11 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { |
virtual ~GpuMemoryBufferImpl(); |
- // Creates a GPU memory buffer instance with |size| and |internalformat| for |
- // |usage| by the current process and |client_id|. |
+ // Creates a GPU memory buffer instance with |size| and |format| for |usage| |
+ // by the current process and |client_id|. |
static void Create(const gfx::Size& size, |
- unsigned internalformat, |
- unsigned usage, |
+ Format format, |
+ Usage usage, |
int client_id, |
const CreationCallback& callback); |
@@ -35,8 +35,8 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { |
// by |child_process| and |child_client_id|. The |handle| returned can be |
// used by the |child_process| to create an instance of this class. |
static void AllocateForChildProcess(const gfx::Size& size, |
- unsigned internalformat, |
- unsigned usage, |
+ Format format, |
+ Usage usage, |
base::ProcessHandle child_process, |
int child_client_id, |
const AllocationCallback& callback); |
@@ -53,29 +53,28 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { |
static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( |
const gfx::GpuMemoryBufferHandle& handle, |
const gfx::Size& size, |
- unsigned internalformat, |
+ Format format, |
const DestructionCallback& callback); |
- // Returns true if |internalformat| is a format recognized by this base class. |
- static bool IsFormatValid(unsigned internalformat); |
- |
- // Returns true if |usage| is recognized by this base class. |
- static bool IsUsageValid(unsigned usage); |
+ // Type-checking upcast routine. Returns an NULL on failure. |
+ static GpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer); |
// Returns the number of bytes per pixel that must be used by an |
- // implementation when using |internalformat|. |
- static size_t BytesPerPixel(unsigned internalformat); |
+ // implementation when using |format|. |
+ static size_t BytesPerPixel(Format format); |
// Overridden from gfx::GpuMemoryBuffer: |
virtual bool IsMapped() const override; |
+ virtual Format GetFormat() const override; |
+ virtual ClientBuffer AsClientBuffer() override; |
protected: |
GpuMemoryBufferImpl(const gfx::Size& size, |
- unsigned internalformat, |
+ Format format, |
const DestructionCallback& callback); |
const gfx::Size size_; |
- const unsigned internalformat_; |
+ const Format format_; |
const DestructionCallback callback_; |
bool mapped_; |