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

Unified Diff: gpu/command_buffer/service/texture_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 | « gpu/command_buffer/service/renderbuffer_manager.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/texture_manager.h
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h
index f2e7963e7cf3e4204c66aa4037adbc5c7d0ac9f9..8c3100b4a74faebb0c044a1d433ed1ae5d459e76 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -13,6 +13,7 @@
#include "base/memory/ref_counted.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/gl_utils.h"
+#include "gpu/command_buffer/service/memory_tracking.h"
#include "gpu/gpu_export.h"
#include "ui/gl/gl_image.h"
@@ -22,8 +23,6 @@ namespace gles2 {
class GLES2Decoder;
class Display;
class TextureDefinition;
-class MemoryTracker;
-class MemoryTypeTracker;
// This class keeps track of the textures and their sizes so we can do NPOT and
// texture complete checking.
@@ -312,6 +311,11 @@ class GPU_EXPORT TextureManager {
GLenum wrap_t_;
GLenum usage_;
+ // The accounting pool towards which the memory for this allocation should
+ // be charged. This will be rolled into a new GLenum texture parameter in
+ // a separate change.
+ MemoryTracker::Pool tracking_pool_;
+
// The maximum level that has been set.
GLint max_level_set_;
@@ -508,8 +512,10 @@ class GPU_EXPORT TextureManager {
}
}
- uint32 mem_represented() const {
- return mem_represented_;
+ size_t mem_represented() const {
+ return
+ memory_tracker_managed_->GetMemRepresented() +
+ memory_tracker_unmanaged_->GetMemRepresented();
}
void SetLevelImage(
@@ -530,12 +536,12 @@ class GPU_EXPORT TextureManager {
GLenum target,
GLuint* black_texture);
- void UpdateMemRepresented();
-
void StartTracking(TextureInfo* info);
void StopTracking(TextureInfo* info);
- scoped_ptr<MemoryTypeTracker> texture_memory_tracker_;
+ MemoryTypeTracker* GetMemTracker(MemoryTracker::Pool tracking_pool);
+ scoped_ptr<MemoryTypeTracker> memory_tracker_managed_;
+ scoped_ptr<MemoryTypeTracker> memory_tracker_unmanaged_;
FeatureInfo::Ref feature_info_;
@@ -556,8 +562,6 @@ class GPU_EXPORT TextureManager {
// Allows to check no TextureInfo will outlive this.
unsigned int texture_info_count_;
- uint32 mem_represented_;
-
bool have_context_;
// Black (0,0,0,1) textures for when non-renderable textures are used.
« no previous file with comments | « gpu/command_buffer/service/renderbuffer_manager.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698