summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r--gpu/command_buffer/service/buffer_manager.h4
-rw-r--r--gpu/command_buffer/service/context_group.cc11
-rw-r--r--gpu/command_buffer/service/context_group.h2
-rw-r--r--gpu/command_buffer/service/renderbuffer_manager.h4
-rw-r--r--gpu/command_buffer/service/texture_manager.h4
5 files changed, 25 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/buffer_manager.h b/gpu/command_buffer/service/buffer_manager.h
index b3b4ede..49715cc 100644
--- a/gpu/command_buffer/service/buffer_manager.h
+++ b/gpu/command_buffer/service/buffer_manager.h
@@ -183,6 +183,10 @@ class GPU_EXPORT BufferManager {
allow_buffers_on_multiple_targets_ = allow;
}
+ size_t mem_represented() const {
+ return mem_represented_;
+ }
+
private:
void UpdateMemRepresented();
diff --git a/gpu/command_buffer/service/context_group.cc b/gpu/command_buffer/service/context_group.cc
index 81fd606..cc86ce5 100644
--- a/gpu/command_buffer/service/context_group.cc
+++ b/gpu/command_buffer/service/context_group.cc
@@ -239,6 +239,17 @@ IdAllocatorInterface* ContextGroup::GetIdAllocator(unsigned namespace_id) {
return id_namespaces_[namespace_id].get();
}
+uint32 ContextGroup::GetMemRepresented() const {
+ uint32 total = 0;
+ if (buffer_manager_.get())
+ total += buffer_manager_->mem_represented();
+ if (renderbuffer_manager_.get())
+ total += renderbuffer_manager_->mem_represented();
+ if (texture_manager_.get())
+ total += texture_manager_->mem_represented();
+ return total;
+}
+
ContextGroup::~ContextGroup() {
CHECK(num_contexts_ == 0);
}
diff --git a/gpu/command_buffer/service/context_group.h b/gpu/command_buffer/service/context_group.h
index bf76308..2f3eaf9 100644
--- a/gpu/command_buffer/service/context_group.h
+++ b/gpu/command_buffer/service/context_group.h
@@ -122,6 +122,8 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
IdAllocatorInterface* GetIdAllocator(unsigned namespace_id);
+ uint32 GetMemRepresented() const;
+
private:
friend class base::RefCounted<ContextGroup>;
~ContextGroup();
diff --git a/gpu/command_buffer/service/renderbuffer_manager.h b/gpu/command_buffer/service/renderbuffer_manager.h
index 483c193..6a99e2f 100644
--- a/gpu/command_buffer/service/renderbuffer_manager.h
+++ b/gpu/command_buffer/service/renderbuffer_manager.h
@@ -160,6 +160,10 @@ class GPU_EXPORT RenderbufferManager {
// Gets a client id for a given service id.
bool GetClientId(GLuint service_id, GLuint* client_id) const;
+ size_t mem_represented() const {
+ return mem_represented_;
+ }
+
private:
void UpdateMemRepresented();
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h
index 927711c..a157146 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -509,6 +509,10 @@ class GPU_EXPORT TextureManager {
}
}
+ uint32 mem_represented() const {
+ return mem_represented_;
+ }
+
private:
// Helper for Initialize().
TextureInfo::Ref CreateDefaultAndBlackTextures(