diff options
author | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-18 03:11:41 +0000 |
---|---|---|
committer | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-18 03:11:41 +0000 |
commit | fb246af3f30a1775ffbcf4bdcf6bb347cd5382d1 (patch) | |
tree | 96b7c08eece7a503bffeff78a5a05e84fa8e82da /content/common/gpu/gpu_memory_manager.h | |
parent | 29ba4e8e183d317620e75fc54f46c96e3ce7c061 (diff) | |
download | chromium_src-fb246af3f30a1775ffbcf4bdcf6bb347cd5382d1.zip chromium_src-fb246af3f30a1775ffbcf4bdcf6bb347cd5382d1.tar.gz chromium_src-fb246af3f30a1775ffbcf4bdcf6bb347cd5382d1.tar.bz2 |
Add GPU memory tab to the task manager.
Each renderer process will have all of the resources that the GPU process has allocated on its behalf (including WebGL resources, compositor resources, and the backbuffer) included in its printed total.
The GPU process will have the all resources currently allocated by the GPU process in its column. This will be approximately the sum of all other rows. The row for the GPU process is printed in ()s to draw attention to the fact that its size includes duplicates from other processes' sizes.
I happy this UI scheme (having played with a few), but I'd wider feedback.
Note that we do not account for swapchains or for backbuffers allocated by the browser process, so those allocations are not counted in the total.
BUG=140157
Review URL: https://chromiumcodereview.appspot.com/10854076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152233 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/gpu/gpu_memory_manager.h')
-rw-r--r-- | content/common/gpu/gpu_memory_manager.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/content/common/gpu/gpu_memory_manager.h b/content/common/gpu/gpu_memory_manager.h index 85c0e01..015f0b0 100644 --- a/content/common/gpu/gpu_memory_manager.h +++ b/content/common/gpu/gpu_memory_manager.h @@ -7,6 +7,7 @@ #if defined(ENABLE_GPU) +#include <set> #include <vector> #include "base/basictypes.h" @@ -15,9 +16,11 @@ #include "base/memory/weak_ptr.h" #include "content/common/content_export.h" #include "content/common/gpu/gpu_memory_allocation.h" +#include "content/public/common/gpu_memory_stats.h" #include "ui/gfx/size.h" class GpuCommandBufferStubBase; +class GpuMemoryTrackingGroup; #if defined(COMPILER_GCC) namespace BASE_HASH_NAMESPACE { @@ -63,6 +66,14 @@ class CONTENT_EXPORT GpuMemoryManager : // queued delayed manage. void ScheduleManage(bool immediate); + // Retrieve GPU Resource consumption statistics for the task manager + void GetVideoMemoryUsageStats( + content::GPUVideoMemoryUsageStats& video_memory_usage_stats) const; + + // Add and remove structures to track context groups' memory consumption + void AddTrackingGroup(GpuMemoryTrackingGroup* tracking_group); + void RemoveTrackingGroup(GpuMemoryTrackingGroup* tracking_group); + // Returns StubMemoryStat's for each GpuCommandBufferStubBase, which were // assigned during the most recent call to Manage(). // Useful for tracking the memory-allocation-related presumed state of the @@ -81,6 +92,9 @@ class CONTENT_EXPORT GpuMemoryManager : void Manage(); + // The context groups' tracking structures + std::set<GpuMemoryTrackingGroup*> tracking_groups_; + size_t CalculateBonusMemoryAllocationBasedOnSize(gfx::Size size) const; size_t GetAvailableGpuMemory() const { |