Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "ui/gfx/gpu_memory_buffer.h" | 9 #include "ui/gfx/gpu_memory_buffer.h" |
| 10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 // Provides common implementation of a GPU memory buffer. | 14 // Provides common implementation of a GPU memory buffer. |
| 15 class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { | 15 class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { |
| 16 public: | 16 public: |
| 17 static scoped_ptr<GpuMemoryBufferImpl> Create( | 17 static scoped_ptr<GpuMemoryBufferImpl> Create( |
| 18 gfx::GpuMemoryBufferHandle handle, | 18 gfx::GpuMemoryBufferHandle handle, |
| 19 gfx::Size size, | 19 gfx::Size size, |
| 20 unsigned internalformat); | 20 unsigned internalformat, |
| 21 gfx::GpuMemoryBuffer::Usage usage); | |
| 21 | 22 |
| 22 virtual ~GpuMemoryBufferImpl(); | 23 virtual ~GpuMemoryBufferImpl(); |
| 23 | 24 |
| 24 static bool IsFormatValid(unsigned internalformat); | 25 static bool IsFormatValid(unsigned internalformat); |
| 25 static size_t BytesPerPixel(unsigned internalformat); | 26 static size_t BytesPerPixel(unsigned internalformat); |
| 26 | 27 |
| 27 // Overridden from gfx::GpuMemoryBuffer: | 28 // Overridden from gfx::GpuMemoryBuffer: |
| 28 virtual bool IsMapped() const OVERRIDE; | 29 virtual bool IsMapped() const OVERRIDE; |
| 29 virtual uint32 GetStride() const OVERRIDE; | 30 virtual uint32 GetStride() const OVERRIDE; |
| 30 | 31 |
| 31 protected: | 32 protected: |
| 32 GpuMemoryBufferImpl(gfx::Size size, unsigned internalformat); | 33 GpuMemoryBufferImpl(gfx::Size size, |
| 34 unsigned internalformat, | |
| 35 gfx::GpuMemoryBuffer::Usage usage); | |
| 33 | 36 |
| 34 const gfx::Size size_; | 37 const gfx::Size size_; |
| 35 unsigned internalformat_; | 38 unsigned internalformat_; |
| 39 gfx::GpuMemoryBuffer::Usage usage_; | |
|
reveman
2014/04/30 11:31:28
Doesn't seem to be used by this class. I don't thi
| |
| 36 bool mapped_; | 40 bool mapped_; |
| 37 | 41 |
| 38 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl); | 42 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl); |
| 39 }; | 43 }; |
| 40 | 44 |
| 41 } // namespace content | 45 } // namespace content |
| 42 | 46 |
| 43 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ | 47 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ |
| OLD | NEW |