Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Unified Diff: content/common/gpu/gpu_memory_manager.h

Issue 10854076: Add GPU memory tab to the task manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/gpu_memory_manager.h
diff --git a/content/common/gpu/gpu_memory_manager.h b/content/common/gpu/gpu_memory_manager.h
index 1023120ee2364a6f71768ca042121a112b25505f..e8377df327b3bab3232e8d0f35173d783d2cd9be 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 {

Powered by Google App Engine
This is Rietveld 408576698