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 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" | 5 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
6 | 6 |
7 #include "ui/gl/gl_bindings.h" | 7 #include "ui/gl/gl_bindings.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
11 GpuMemoryBufferImpl::GpuMemoryBufferImpl(const gfx::Size& size, | 11 GpuMemoryBufferImpl::GpuMemoryBufferImpl(gfx::GpuMemoryBufferId id, |
| 12 const gfx::Size& size, |
12 Format format, | 13 Format format, |
13 const DestructionCallback& callback) | 14 const DestructionCallback& callback) |
14 : size_(size), format_(format), callback_(callback), mapped_(false) { | 15 : id_(id), |
| 16 size_(size), |
| 17 format_(format), |
| 18 callback_(callback), |
| 19 mapped_(false) { |
15 } | 20 } |
16 | 21 |
17 GpuMemoryBufferImpl::~GpuMemoryBufferImpl() { | 22 GpuMemoryBufferImpl::~GpuMemoryBufferImpl() { |
18 callback_.Run(); | 23 callback_.Run(); |
19 } | 24 } |
20 | 25 |
21 // static | 26 // static |
22 GpuMemoryBufferImpl* GpuMemoryBufferImpl::FromClientBuffer( | 27 GpuMemoryBufferImpl* GpuMemoryBufferImpl::FromClientBuffer( |
23 ClientBuffer buffer) { | 28 ClientBuffer buffer) { |
24 return reinterpret_cast<GpuMemoryBufferImpl*>(buffer); | 29 return reinterpret_cast<GpuMemoryBufferImpl*>(buffer); |
(...skipping 18 matching lines...) Expand all Loading... |
43 | 48 |
44 bool GpuMemoryBufferImpl::IsMapped() const { | 49 bool GpuMemoryBufferImpl::IsMapped() const { |
45 return mapped_; | 50 return mapped_; |
46 } | 51 } |
47 | 52 |
48 ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() { | 53 ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() { |
49 return reinterpret_cast<ClientBuffer>(this); | 54 return reinterpret_cast<ClientBuffer>(this); |
50 } | 55 } |
51 | 56 |
52 } // namespace content | 57 } // namespace content |
OLD | NEW |