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

Unified Diff: gpu/command_buffer/service/framebuffer_manager.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
Index: gpu/command_buffer/service/framebuffer_manager.cc
===================================================================
--- gpu/command_buffer/service/framebuffer_manager.cc (revision 51426)
+++ gpu/command_buffer/service/framebuffer_manager.cc (working copy)
@@ -9,6 +9,24 @@
namespace gpu {
namespace gles2 {
+FramebufferManager::~FramebufferManager() {
+ DCHECK(framebuffer_infos_.empty());
+}
+
+void FramebufferManager::Destroy(bool have_context) {
+ while (!framebuffer_infos_.empty()) {
+ if (have_context) {
+ FramebufferInfo* info = framebuffer_infos_.begin()->second;
+ if (!info->IsDeleted()) {
+ GLuint service_id = info->service_id();
+ glDeleteFramebuffersEXT(1, &service_id);
+ info->MarkAsDeleted();
+ }
+ }
+ framebuffer_infos_.erase(framebuffer_infos_.begin());
+ }
+}
+
void FramebufferManager::CreateFramebufferInfo(
GLuint client_id, GLuint service_id) {
std::pair<FramebufferInfoMap::iterator, bool> result =
« no previous file with comments | « gpu/command_buffer/service/framebuffer_manager.h ('k') | gpu/command_buffer/service/framebuffer_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698