OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gpu_memory_tracking.h" | 5 #include "gpu/ipc/service/gpu_memory_tracking.h" |
6 | 6 |
7 #include "content/common/gpu/gpu_memory_manager.h" | 7 #include "gpu/ipc/service/gpu_memory_manager.h" |
8 | 8 |
9 namespace content { | 9 namespace gpu { |
10 | 10 |
11 GpuMemoryTrackingGroup::GpuMemoryTrackingGroup( | 11 GpuMemoryTrackingGroup::GpuMemoryTrackingGroup( |
12 base::ProcessId pid, | 12 base::ProcessId pid, |
13 gpu::gles2::MemoryTracker* memory_tracker, | 13 gles2::MemoryTracker* memory_tracker, |
14 GpuMemoryManager* memory_manager) | 14 GpuMemoryManager* memory_manager) |
15 : pid_(pid), | 15 : pid_(pid), |
16 size_(0), | 16 size_(0), |
17 hibernated_(false), | 17 hibernated_(false), |
18 memory_tracker_(memory_tracker), | 18 memory_tracker_(memory_tracker), |
19 memory_manager_(memory_manager) { | 19 memory_manager_(memory_manager) { |
20 } | 20 } |
21 | 21 |
22 GpuMemoryTrackingGroup::~GpuMemoryTrackingGroup() { | 22 GpuMemoryTrackingGroup::~GpuMemoryTrackingGroup() { |
23 memory_manager_->OnDestroyTrackingGroup(this); | 23 memory_manager_->OnDestroyTrackingGroup(this); |
24 } | 24 } |
25 | 25 |
26 void GpuMemoryTrackingGroup::TrackMemoryAllocatedChange(uint64_t old_size, | 26 void GpuMemoryTrackingGroup::TrackMemoryAllocatedChange(uint64_t old_size, |
27 uint64_t new_size) { | 27 uint64_t new_size) { |
28 memory_manager_->TrackMemoryAllocatedChange( | 28 memory_manager_->TrackMemoryAllocatedChange( |
29 this, old_size, new_size); | 29 this, old_size, new_size); |
30 } | 30 } |
31 | 31 |
32 bool GpuMemoryTrackingGroup::EnsureGPUMemoryAvailable(uint64_t size_needed) { | 32 bool GpuMemoryTrackingGroup::EnsureGPUMemoryAvailable(uint64_t size_needed) { |
33 return memory_manager_->EnsureGPUMemoryAvailable(size_needed); | 33 return memory_manager_->EnsureGPUMemoryAvailable(size_needed); |
34 } | 34 } |
35 | 35 |
36 | 36 |
37 } // namespace content | 37 } // namespace gpu |
OLD | NEW |