summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/shader_manager.cc
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-01 22:41:16 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-01 22:41:16 +0000
commitd304cbdeccf3db7330c09cb218096a45a2bdc746 (patch)
treed0b939398f1fe3f4beb1def5fbede824d1dea94d /gpu/command_buffer/service/shader_manager.cc
parente7f7509f4ab3672f61e6fc5ec6b5ce0b5eefb4a8 (diff)
downloadchromium_src-d304cbdeccf3db7330c09cb218096a45a2bdc746.zip
chromium_src-d304cbdeccf3db7330c09cb218096a45a2bdc746.tar.gz
chromium_src-d304cbdeccf3db7330c09cb218096a45a2bdc746.tar.bz2
Free the resources used by a context group.
TEST=unit tests BUG=none Review URL: http://codereview.chromium.org/2880013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51441 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/shader_manager.cc')
-rw-r--r--gpu/command_buffer/service/shader_manager.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/shader_manager.cc b/gpu/command_buffer/service/shader_manager.cc
index 36a7b1a..eb4a899 100644
--- a/gpu/command_buffer/service/shader_manager.cc
+++ b/gpu/command_buffer/service/shader_manager.cc
@@ -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) {