Add global tracking of GPU memory allocations. Have each ContextGroup push memory tracking information to the GpuMemoryManager. With this we can determine if we transiently oversubscribe.
BUG=135525
TEST=
Review URL: https://chromiumcodereview.appspot.com/10796096
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148880 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h
index a157146..33c378d 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -20,6 +20,8 @@
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.
@@ -351,7 +353,8 @@
DISALLOW_COPY_AND_ASSIGN(TextureInfo);
};
- TextureManager(FeatureInfo* feature_info,
+ TextureManager(MemoryTracker* memory_tracker,
+ FeatureInfo* feature_info,
GLsizei max_texture_size,
GLsizei max_cube_map_texture_size);
~TextureManager();
@@ -524,6 +527,8 @@
void StartTracking(TextureInfo* info);
void StopTracking(TextureInfo* info);
+ scoped_ptr<MemoryTypeTracker> texture_memory_tracker_;
+
FeatureInfo::Ref feature_info_;
// Info for each texture in the system.
@@ -544,7 +549,6 @@
unsigned int texture_info_count_;
uint32 mem_represented_;
- uint32 last_reported_mem_represented_;
bool have_context_;