OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "gpu/command_buffer/common/buffer.h" | 5 #include "gpu/command_buffer/common/buffer.h" |
6 | 6 |
| 7 #include "base/logging.h" |
| 8 |
7 namespace gpu { | 9 namespace gpu { |
8 | 10 |
9 Buffer::Buffer(scoped_ptr<base::SharedMemory> shared_memory, size_t size) | 11 Buffer::Buffer(scoped_ptr<base::SharedMemory> shared_memory, size_t size) |
10 : shared_memory_(shared_memory.Pass()), | 12 : shared_memory_(shared_memory.Pass()), |
11 memory_(shared_memory_->memory()), | 13 memory_(shared_memory_->memory()), |
12 size_(size) {} | 14 size_(size) { |
| 15 DCHECK(memory_) << "The memory must be mapped to create a Buffer"; |
| 16 } |
13 | 17 |
14 Buffer::~Buffer() {} | 18 Buffer::~Buffer() {} |
15 | 19 |
16 } // namespace gpu | 20 } // namespace gpu |
OLD | NEW |