diff options
author | Torne (Richard Coles) <torne@google.com> | 2013-03-28 15:31:22 +0000 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2013-03-28 15:31:22 +0000 |
commit | 2a99a7e74a7f215066514fe81d2bfa6639d9eddd (patch) | |
tree | 7c2d04841fcd599fd83b0f0bb1100e1c89a35bae /content/common/gpu/gpu_memory_tracking.cc | |
parent | 61c449bbbb53310a8c041d8cefdd6b01a126cc7e (diff) | |
download | chromium_org-2a99a7e74a7f215066514fe81d2bfa6639d9eddd.tar.gz |
Merge from Chromium at DEPS revision r190564
This commit was generated by merge_to_master.py.
Change-Id: Icadecbce29854b8fa25fd335b2c1949b5ca5d170
Diffstat (limited to 'content/common/gpu/gpu_memory_tracking.cc')
-rw-r--r-- | content/common/gpu/gpu_memory_tracking.cc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/content/common/gpu/gpu_memory_tracking.cc b/content/common/gpu/gpu_memory_tracking.cc new file mode 100644 index 0000000000..e2d1fc7f8f --- /dev/null +++ b/content/common/gpu/gpu_memory_tracking.cc @@ -0,0 +1,39 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/common/gpu/gpu_memory_tracking.h" + +#include "content/common/gpu/gpu_memory_manager.h" + +namespace content { + +GpuMemoryTrackingGroup::GpuMemoryTrackingGroup( + base::ProcessId pid, + gpu::gles2::MemoryTracker* memory_tracker, + GpuMemoryManager* memory_manager) + : pid_(pid), + size_(0), + hibernated_(false), + memory_tracker_(memory_tracker), + memory_manager_(memory_manager) { +} + +GpuMemoryTrackingGroup::~GpuMemoryTrackingGroup() { + memory_manager_->OnDestroyTrackingGroup(this); +} + +void GpuMemoryTrackingGroup::TrackMemoryAllocatedChange( + uint64 old_size, + uint64 new_size, + gpu::gles2::MemoryTracker::Pool tracking_pool) { + memory_manager_->TrackMemoryAllocatedChange( + this, old_size, new_size, tracking_pool); +} + +bool GpuMemoryTrackingGroup::EnsureGPUMemoryAvailable(uint64 size_needed) { + return memory_manager_->EnsureGPUMemoryAvailable(size_needed); +} + + +} // namespace content |