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