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

Unified Diff: gpu/command_buffer/service/shader_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
« no previous file with comments | « gpu/command_buffer/service/shader_manager.h ('k') | gpu/command_buffer/service/shader_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/shader_manager.cc
===================================================================
--- gpu/command_buffer/service/shader_manager.cc (revision 51426)
+++ gpu/command_buffer/service/shader_manager.cc (working copy)
@@ -8,6 +8,23 @@
namespace gpu {
namespace gles2 {
+ShaderManager::~ShaderManager() {
+ DCHECK(shader_infos_.empty());
+}
+
+void ShaderManager::Destroy(bool have_context) {
+ while (!shader_infos_.empty()) {
+ if (have_context) {
+ ShaderInfo* info = shader_infos_.begin()->second;
+ if (!info->IsDeleted()) {
+ glDeleteShader(info->service_id());
+ info->MarkAsDeleted();
+ }
+ }
+ shader_infos_.erase(shader_infos_.begin());
+ }
+}
+
void ShaderManager::CreateShaderInfo(GLuint client_id,
GLuint service_id,
GLenum shader_type) {
« no previous file with comments | « gpu/command_buffer/service/shader_manager.h ('k') | gpu/command_buffer/service/shader_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698