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_manager_client.h" | 5 #include "content/common/gpu/gpu_memory_manager_client.h" |
6 | 6 |
7 #if defined(ENABLE_GPU) | 7 #if defined(ENABLE_GPU) |
8 | 8 |
9 #include "content/common/gpu/gpu_memory_manager.h" | 9 #include "content/common/gpu/gpu_memory_manager.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 GpuMemoryManagerClientState::GpuMemoryManagerClientState( | 13 GpuMemoryManagerClientState::GpuMemoryManagerClientState( |
14 GpuMemoryManager* memory_manager, | 14 GpuMemoryManager* memory_manager, |
15 GpuMemoryManagerClient* client, | 15 GpuMemoryManagerClient* client, |
16 GpuMemoryTrackingGroup* tracking_group, | 16 GpuMemoryTrackingGroup* tracking_group, |
17 bool has_surface, | 17 bool has_surface, |
18 bool visible) | 18 bool visible) |
19 : memory_manager_(memory_manager), | 19 : memory_manager_(memory_manager), |
20 client_(client), | 20 client_(client), |
21 tracking_group_(tracking_group), | 21 tracking_group_(tracking_group), |
22 has_surface_(has_surface), | 22 has_surface_(has_surface), |
23 visible_(visible), | 23 visible_(visible), |
24 list_iterator_valid_(false), | 24 list_iterator_valid_(false), |
| 25 managed_memory_stats_received_(false), |
25 bytes_nicetohave_limit_low_(0), | 26 bytes_nicetohave_limit_low_(0), |
26 bytes_nicetohave_limit_high_(0), | 27 bytes_nicetohave_limit_high_(0), |
27 bytes_allocation_when_visible_(0), | 28 bytes_allocation_when_visible_(0), |
28 bytes_allocation_when_nonvisible_(0), | 29 bytes_allocation_when_nonvisible_(0), |
29 bytes_allocation_ideal_nicetohave_(0), | 30 bytes_allocation_ideal_nicetohave_(0), |
30 bytes_allocation_ideal_required_(0), | 31 bytes_allocation_ideal_required_(0), |
31 bytes_allocation_ideal_minimum_(0), | 32 bytes_allocation_ideal_minimum_(0), |
32 hibernated_(false) { | 33 hibernated_(false) { |
33 } | 34 } |
34 | 35 |
35 GpuMemoryManagerClientState::~GpuMemoryManagerClientState() { | 36 GpuMemoryManagerClientState::~GpuMemoryManagerClientState() { |
36 memory_manager_->OnDestroyClientState(this); | 37 memory_manager_->OnDestroyClientState(this); |
37 } | 38 } |
38 | 39 |
39 void GpuMemoryManagerClientState::SetVisible(bool visible) { | 40 void GpuMemoryManagerClientState::SetVisible(bool visible) { |
40 memory_manager_->SetClientStateVisible(this, visible); | 41 memory_manager_->SetClientStateVisible(this, visible); |
41 } | 42 } |
42 | 43 |
43 void GpuMemoryManagerClientState::SetManagedMemoryStats( | 44 void GpuMemoryManagerClientState::SetManagedMemoryStats( |
44 const GpuManagedMemoryStats& stats) { | 45 const GpuManagedMemoryStats& stats) { |
45 memory_manager_->SetClientStateManagedMemoryStats(this, stats); | 46 memory_manager_->SetClientStateManagedMemoryStats(this, stats); |
46 } | 47 } |
47 | 48 |
48 } // namespace content | 49 } // namespace content |
49 | 50 |
50 #endif | 51 #endif |
OLD | NEW |