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

Unified Diff: gpu/command_buffer/service/context_group.cc

Issue 2880013: Free the resources used by a context group. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 months 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/context_group.h ('k') | gpu/command_buffer/service/framebuffer_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/context_group.cc
===================================================================
--- gpu/command_buffer/service/context_group.cc (revision 51426)
+++ gpu/command_buffer/service/context_group.cc (working copy)
@@ -26,6 +26,13 @@
}
ContextGroup::~ContextGroup() {
+ // Check that Destroy has been called.
+ DCHECK(buffer_manager_ == NULL);
+ DCHECK(framebuffer_manager_ == NULL);
+ DCHECK(renderbuffer_manager_ == NULL);
+ DCHECK(texture_manager_ == NULL);
+ DCHECK(program_manager_ == NULL);
+ DCHECK(shader_manager_ == NULL);
}
static void GetIntegerv(GLenum pname, uint32* var) {
@@ -87,6 +94,38 @@
return true;
}
+void ContextGroup::Destroy(bool have_context) {
+ if (buffer_manager_ != NULL) {
+ buffer_manager_->Destroy(have_context);
+ buffer_manager_.reset();
+ }
+
+ if (framebuffer_manager_ != NULL) {
+ framebuffer_manager_->Destroy(have_context);
+ framebuffer_manager_.reset();
+ }
+
+ if (renderbuffer_manager_ != NULL) {
+ renderbuffer_manager_->Destroy(have_context);
+ renderbuffer_manager_.reset();
+ }
+
+ if (texture_manager_ != NULL) {
+ texture_manager_->Destroy(have_context);
+ texture_manager_.reset();
+ }
+
+ if (program_manager_ != NULL) {
+ program_manager_->Destroy(have_context);
+ program_manager_.reset();
+ }
+
+ if (shader_manager_ != NULL) {
+ shader_manager_->Destroy(have_context);
+ shader_manager_.reset();
+ }
+}
+
IdAllocator* ContextGroup::GetIdAllocator(unsigned namespace_id) {
IdAllocatorMap::iterator it = id_namespaces_.find(namespace_id);
if (it != id_namespaces_.end()) {
« no previous file with comments | « gpu/command_buffer/service/context_group.h ('k') | gpu/command_buffer/service/framebuffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698