GPU workaround to simulate Out of Memory errors with large textures
[chromium-blink-merge.git] / content / common / gpu / gpu_memory_manager_client.cc
blob30d5434a1ff13f2e99021a498ba5d4a87d657699
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 #include "content/common/gpu/gpu_memory_manager.h"
9 namespace content {
11 GpuMemoryManagerClientState::GpuMemoryManagerClientState(
12 GpuMemoryManager* memory_manager,
13 GpuMemoryManagerClient* client,
14 GpuMemoryTrackingGroup* tracking_group,
15 bool has_surface,
16 bool visible)
17 : memory_manager_(memory_manager),
18 client_(client),
19 tracking_group_(tracking_group),
20 has_surface_(has_surface),
21 visible_(visible),
22 list_iterator_valid_(false),
23 hibernated_(false) {
26 GpuMemoryManagerClientState::~GpuMemoryManagerClientState() {
27 memory_manager_->OnDestroyClientState(this);
30 void GpuMemoryManagerClientState::SetVisible(bool visible) {
31 memory_manager_->SetClientStateVisible(this, visible);
34 } // namespace content