OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 | 11 |
12 namespace gpu { | 12 namespace gpu { |
13 namespace gles2 { | 13 namespace gles2 { |
14 | 14 |
15 ShaderManager::ShaderInfo::ShaderInfo(GLuint service_id, GLenum shader_type) | 15 ShaderManager::ShaderInfo::ShaderInfo(GLuint service_id, GLenum shader_type) |
16 : use_count_(0), | 16 : use_count_(0), |
17 service_id_(service_id), | 17 service_id_(service_id), |
18 shader_type_(shader_type), | 18 shader_type_(shader_type), |
19 valid_(false), | 19 valid_(false), |
20 source_compiled_(false) { | 20 compilation_status_(NOT_COMPILED) { |
21 } | 21 } |
22 | 22 |
23 ShaderManager::ShaderInfo::~ShaderInfo() { | 23 ShaderManager::ShaderInfo::~ShaderInfo() { |
24 } | 24 } |
25 | 25 |
26 void ShaderManager::ShaderInfo::IncUseCount() { | 26 void ShaderManager::ShaderInfo::IncUseCount() { |
27 ++use_count_; | 27 ++use_count_; |
28 } | 28 } |
29 | 29 |
30 void ShaderManager::ShaderInfo::DecUseCount() { | 30 void ShaderManager::ShaderInfo::DecUseCount() { |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 DCHECK(info); | 163 DCHECK(info); |
164 DCHECK(IsOwned(info)); | 164 DCHECK(IsOwned(info)); |
165 info->DecUseCount(); | 165 info->DecUseCount(); |
166 RemoveShaderInfoIfUnused(info); | 166 RemoveShaderInfoIfUnused(info); |
167 } | 167 } |
168 | 168 |
169 } // namespace gles2 | 169 } // namespace gles2 |
170 } // namespace gpu | 170 } // namespace gpu |
171 | 171 |
172 | 172 |
OLD | NEW |