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

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

Issue 11516014: Track managed memory usage in the command buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test compile error Created 8 years 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
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | content/common/gpu/gpu_memory_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bbd4cd28b5bd8f3dca803489838a57f7bea4d33a..4e585a973edf1c932751fe737014dc50dc9ffa82 100644
--- a/content/common/gpu/gpu_memory_manager.h
+++ b/content/common/gpu/gpu_memory_manager.h
@@ -77,7 +77,10 @@ class CONTENT_EXPORT GpuMemoryManager :
void RemoveTrackingGroup(GpuMemoryTrackingGroup* tracking_group);
// Track a change in memory allocated by any context
- void TrackMemoryAllocatedChange(size_t old_size, size_t new_size);
+ void TrackMemoryAllocatedChange(
+ size_t old_size,
+ size_t new_size,
+ gpu::gles2::MemoryTracker::Pool tracking_pool);
private:
friend class GpuMemoryManagerTest;
@@ -175,6 +178,12 @@ class CONTENT_EXPORT GpuMemoryManager :
// Send memory usage stats to the browser process.
void SendUmaStatsToBrowser();
+ // Get the current number of bytes allocated.
+ size_t GetCurrentUsage() const {
+ return bytes_allocated_managed_current_ +
+ bytes_allocated_unmanaged_current_;
+ }
+
// Interfaces for testing
void TestingSetClientVisible(GpuMemoryManagerClient* client, bool visible);
void TestingSetClientLastUsedTime(GpuMemoryManagerClient* client,
@@ -216,9 +225,10 @@ class CONTENT_EXPORT GpuMemoryManager :
size_t bytes_backgrounded_available_gpu_memory_;
// The current total memory usage, and historical maximum memory usage
- size_t bytes_allocated_current_;
+ size_t bytes_allocated_managed_current_;
size_t bytes_allocated_managed_visible_;
size_t bytes_allocated_managed_backgrounded_;
+ size_t bytes_allocated_unmanaged_current_;
size_t bytes_allocated_historical_max_;
// The number of browser windows that exist. If we ever receive a
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | content/common/gpu/gpu_memory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698