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

Unified Diff: gpu/command_buffer/service/buffer_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_memory_tracking.h ('k') | gpu/command_buffer/service/buffer_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/buffer_manager.h
diff --git a/gpu/command_buffer/service/buffer_manager.h b/gpu/command_buffer/service/buffer_manager.h
index f807349c3f97aa80067f582084fa8c52b7724af1..ae8fcbbf922f6e0cd7bd443dd0fc173bf4e38de0 100644
--- a/gpu/command_buffer/service/buffer_manager.h
+++ b/gpu/command_buffer/service/buffer_manager.h
@@ -12,14 +12,12 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/gl_utils.h"
+#include "gpu/command_buffer/service/memory_tracking.h"
#include "gpu/gpu_export.h"
namespace gpu {
namespace gles2 {
-class MemoryTracker;
-class MemoryTypeTracker;
-
// This class keeps track of the buffers and their sizes so we can do
// bounds checking.
//
@@ -190,16 +188,14 @@ class GPU_EXPORT BufferManager {
}
size_t mem_represented() const {
- return mem_represented_;
+ return memory_tracker_->GetMemRepresented();
}
private:
- void UpdateMemRepresented();
-
void StartTracking(BufferInfo* info);
void StopTracking(BufferInfo* info);
- scoped_ptr<MemoryTypeTracker> buffer_memory_tracker_;
+ scoped_ptr<MemoryTypeTracker> memory_tracker_;
// Info for each buffer in the system.
typedef base::hash_map<GLuint, BufferInfo::Ref> BufferInfoMap;
@@ -208,8 +204,6 @@ class GPU_EXPORT BufferManager {
// Whether or not buffers can be bound to multiple targets.
bool allow_buffers_on_multiple_targets_;
- size_t mem_represented_;
-
// Counts the number of BufferInfo allocated with 'this' as its manager.
// Allows to check no BufferInfo will outlive this.
unsigned int buffer_info_count_;
« no previous file with comments | « content/common/gpu/gpu_memory_tracking.h ('k') | gpu/command_buffer/service/buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698