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/program_manager.h" | 5 #include "gpu/command_buffer/service/program_manager.h" |
6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 206 } |
207 return false; | 207 return false; |
208 } | 208 } |
209 | 209 |
210 void ProgramManager::ProgramInfo::GetProgramiv(GLenum pname, GLint* params) { | 210 void ProgramManager::ProgramInfo::GetProgramiv(GLenum pname, GLint* params) { |
211 switch (pname) { | 211 switch (pname) { |
212 case GL_ACTIVE_ATTRIBUTES: | 212 case GL_ACTIVE_ATTRIBUTES: |
213 *params = attrib_infos_.size(); | 213 *params = attrib_infos_.size(); |
214 break; | 214 break; |
215 case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: | 215 case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: |
216 *params = max_attrib_name_length_; | 216 // Notice +1 to accomodate NULL terminator. |
| 217 *params = max_attrib_name_length_ + 1; |
217 break; | 218 break; |
218 case GL_ACTIVE_UNIFORMS: | 219 case GL_ACTIVE_UNIFORMS: |
219 *params = uniform_infos_.size(); | 220 *params = uniform_infos_.size(); |
220 break; | 221 break; |
221 case GL_ACTIVE_UNIFORM_MAX_LENGTH: | 222 case GL_ACTIVE_UNIFORM_MAX_LENGTH: |
222 *params = max_uniform_name_length_; | 223 // Notice +1 to accomodate NULL terminator. |
| 224 *params = max_uniform_name_length_ + 1; |
223 break; | 225 break; |
224 default: | 226 default: |
225 glGetProgramiv(program_id_, pname, params); | 227 glGetProgramiv(program_id_, pname, params); |
226 break; | 228 break; |
227 } | 229 } |
228 } | 230 } |
229 | 231 |
230 void ProgramManager::CreateProgramInfo(GLuint program_id) { | 232 void ProgramManager::CreateProgramInfo(GLuint program_id) { |
231 std::pair<ProgramInfoMap::iterator, bool> result = | 233 std::pair<ProgramInfoMap::iterator, bool> result = |
232 program_infos_.insert( | 234 program_infos_.insert( |
(...skipping 12 matching lines...) Expand all Loading... |
245 if (it != program_infos_.end()) { | 247 if (it != program_infos_.end()) { |
246 it->second->MarkAsDeleted(); | 248 it->second->MarkAsDeleted(); |
247 program_infos_.erase(it); | 249 program_infos_.erase(it); |
248 } | 250 } |
249 } | 251 } |
250 | 252 |
251 } // namespace gles2 | 253 } // namespace gles2 |
252 } // namespace gpu | 254 } // namespace gpu |
253 | 255 |
254 | 256 |
OLD | NEW |