OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/shader_manager.h" | 5 #include "gpu/command_buffer/service/shader_manager.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 | 7 |
8 namespace gpu { | 8 namespace gpu { |
9 namespace gles2 { | 9 namespace gles2 { |
10 | 10 |
| 11 ShaderManager::ShaderManager() {} |
| 12 |
11 ShaderManager::~ShaderManager() { | 13 ShaderManager::~ShaderManager() { |
12 DCHECK(shader_infos_.empty()); | 14 DCHECK(shader_infos_.empty()); |
13 } | 15 } |
14 | 16 |
15 void ShaderManager::Destroy(bool have_context) { | 17 void ShaderManager::Destroy(bool have_context) { |
16 while (!shader_infos_.empty()) { | 18 while (!shader_infos_.empty()) { |
17 if (have_context) { | 19 if (have_context) { |
18 ShaderInfo* info = shader_infos_.begin()->second; | 20 ShaderInfo* info = shader_infos_.begin()->second; |
19 if (!info->IsDeleted()) { | 21 if (!info->IsDeleted()) { |
20 glDeleteShader(info->service_id()); | 22 glDeleteShader(info->service_id()); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 return true; | 58 return true; |
57 } | 59 } |
58 } | 60 } |
59 return false; | 61 return false; |
60 } | 62 } |
61 | 63 |
62 } // namespace gles2 | 64 } // namespace gles2 |
63 } // namespace gpu | 65 } // namespace gpu |
64 | 66 |
65 | 67 |
OLD | NEW |