Index: gpu/command_buffer/common/buffer.cc |
diff --git a/gpu/command_buffer/common/buffer.cc b/gpu/command_buffer/common/buffer.cc |
index bbf40a1c7e8ed3020154e960f04b116b455e6a27..3b3da4345d766cc484f5a5c53419db61e0538839 100644 |
--- a/gpu/command_buffer/common/buffer.cc |
+++ b/gpu/command_buffer/common/buffer.cc |
@@ -9,11 +9,23 @@ |
#include "base/numerics/safe_math.h" |
namespace gpu { |
+SharedMemoryBufferBacking::SharedMemoryBufferBacking( |
+ scoped_ptr<base::SharedMemory> shared_memory, |
+ size_t size) |
+ : shared_memory_(shared_memory.Pass()), size_(size) {} |
-Buffer::Buffer(scoped_ptr<base::SharedMemory> shared_memory, size_t size) |
- : shared_memory_(shared_memory.Pass()), |
- memory_(shared_memory_->memory()), |
- size_(size) { |
+SharedMemoryBufferBacking::~SharedMemoryBufferBacking() {} |
+ |
+void* SharedMemoryBufferBacking::GetMemory() const { |
+ return shared_memory_->memory(); |
+} |
+ |
+size_t SharedMemoryBufferBacking::GetSize() const { return size_; } |
+ |
+Buffer::Buffer(scoped_ptr<BufferBacking> backing) |
+ : backing_(backing.Pass()), |
+ memory_(backing_->GetMemory()), |
+ size_(backing_->GetSize()) { |
DCHECK(memory_) << "The memory must be mapped to create a Buffer"; |
} |