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), | 15 : id_(id), |
| 16 size_(size), |
15 format_(format), | 17 format_(format), |
16 callback_(callback), | 18 callback_(callback), |
17 mapped_(false), | 19 mapped_(false), |
18 destruction_sync_point_(0) { | 20 destruction_sync_point_(0) { |
19 } | 21 } |
20 | 22 |
21 GpuMemoryBufferImpl::~GpuMemoryBufferImpl() { | 23 GpuMemoryBufferImpl::~GpuMemoryBufferImpl() { |
22 callback_.Run(destruction_sync_point_); | 24 callback_.Run(destruction_sync_point_); |
23 } | 25 } |
24 | 26 |
(...skipping 22 matching lines...) Expand all Loading... |
47 | 49 |
48 bool GpuMemoryBufferImpl::IsMapped() const { | 50 bool GpuMemoryBufferImpl::IsMapped() const { |
49 return mapped_; | 51 return mapped_; |
50 } | 52 } |
51 | 53 |
52 ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() { | 54 ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() { |
53 return reinterpret_cast<ClientBuffer>(this); | 55 return reinterpret_cast<ClientBuffer>(this); |
54 } | 56 } |
55 | 57 |
56 } // namespace content | 58 } // namespace content |
OLD | NEW |