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.
5 #include "content/common/gpu/gpu_memory_manager_client.h"
7 #if defined(ENABLE_GPU)
9 #include "content/common/gpu/gpu_memory_manager.h"
13 GpuMemoryManagerClientState::GpuMemoryManagerClientState(
14 GpuMemoryManager
* memory_manager
,
15 GpuMemoryManagerClient
* client
,
16 GpuMemoryTrackingGroup
* tracking_group
,
19 : memory_manager_(memory_manager
),
21 tracking_group_(tracking_group
),
22 has_surface_(has_surface
),
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),
36 GpuMemoryManagerClientState::~GpuMemoryManagerClientState() {
37 memory_manager_
->OnDestroyClientState(this);
40 void GpuMemoryManagerClientState::SetVisible(bool visible
) {
41 memory_manager_
->SetClientStateVisible(this, visible
);
44 void GpuMemoryManagerClientState::SetManagedMemoryStats(
45 const GpuManagedMemoryStats
& stats
) {
46 memory_manager_
->SetClientStateManagedMemoryStats(this, stats
);
49 } // namespace content