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