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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/numerics/safe_math.h" | 8 #include "base/numerics/safe_math.h" |
9 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" | 9 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" |
10 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
(...skipping 18 matching lines...) Expand all Loading... | |
29 const DestructionCallback& callback) | 29 const DestructionCallback& callback) |
30 : id_(id), | 30 : id_(id), |
31 size_(size), | 31 size_(size), |
32 format_(format), | 32 format_(format), |
33 callback_(callback), | 33 callback_(callback), |
34 mapped_(false), | 34 mapped_(false), |
35 destruction_sync_point_(0) { | 35 destruction_sync_point_(0) { |
36 } | 36 } |
37 | 37 |
38 GpuMemoryBufferImpl::~GpuMemoryBufferImpl() { | 38 GpuMemoryBufferImpl::~GpuMemoryBufferImpl() { |
39 DCHECK(!mapped_); | |
reveman
2015/05/11 16:40:56
this is fine but unrelated to this change. please
dshwang
2015/05/14 12:25:46
got it
| |
39 callback_.Run(destruction_sync_point_); | 40 callback_.Run(destruction_sync_point_); |
40 } | 41 } |
41 | 42 |
42 // static | 43 // static |
43 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::CreateFromHandle( | 44 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::CreateFromHandle( |
44 const gfx::GpuMemoryBufferHandle& handle, | 45 const gfx::GpuMemoryBufferHandle& handle, |
45 const gfx::Size& size, | 46 const gfx::Size& size, |
46 Format format, | 47 Format format, |
47 const DestructionCallback& callback) { | 48 const DestructionCallback& callback) { |
48 switch (handle.type) { | 49 switch (handle.type) { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 | 191 |
191 bool GpuMemoryBufferImpl::IsMapped() const { | 192 bool GpuMemoryBufferImpl::IsMapped() const { |
192 return mapped_; | 193 return mapped_; |
193 } | 194 } |
194 | 195 |
195 ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() { | 196 ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() { |
196 return reinterpret_cast<ClientBuffer>(this); | 197 return reinterpret_cast<ClientBuffer>(this); |
197 } | 198 } |
198 | 199 |
199 } // namespace content | 200 } // namespace content |
OLD | NEW |