OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 NOTREACHED(); | 25 NOTREACHED(); |
26 return 0; | 26 return 0; |
27 } | 27 } |
28 } | 28 } |
29 | 29 |
30 ProgramManager::ProgramInfo::UniformInfo::UniformInfo(GLsizei _size, | 30 ProgramManager::ProgramInfo::UniformInfo::UniformInfo(GLsizei _size, |
31 GLenum _type, | 31 GLenum _type, |
32 const std::string& _name) | 32 const std::string& _name) |
33 : size(_size), | 33 : size(_size), |
34 type(_type), | 34 type(_type), |
| 35 is_array(false), |
35 name(_name) { | 36 name(_name) { |
36 } | 37 } |
37 | 38 |
38 ProgramManager::ProgramInfo::UniformInfo::~UniformInfo() {} | 39 ProgramManager::ProgramInfo::UniformInfo::~UniformInfo() {} |
39 | 40 |
40 bool ProgramManager::IsInvalidPrefix(const char* name, size_t length) { | 41 bool ProgramManager::IsInvalidPrefix(const char* name, size_t length) { |
41 static const char kInvalidPrefix[] = { 'g', 'l', '_' }; | 42 static const char kInvalidPrefix[] = { 'g', 'l', '_' }; |
42 return (length >= sizeof(kInvalidPrefix) && | 43 return (length >= sizeof(kInvalidPrefix) && |
43 memcmp(name, kInvalidPrefix, sizeof(kInvalidPrefix)) == 0); | 44 memcmp(name, kInvalidPrefix, sizeof(kInvalidPrefix)) == 0); |
44 } | 45 } |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 DCHECK(info); | 506 DCHECK(info); |
506 DCHECK(IsOwned(info)); | 507 DCHECK(IsOwned(info)); |
507 info->DecUseCount(); | 508 info->DecUseCount(); |
508 RemoveProgramInfoIfUnused(shader_manager, info); | 509 RemoveProgramInfoIfUnused(shader_manager, info); |
509 } | 510 } |
510 | 511 |
511 } // namespace gles2 | 512 } // namespace gles2 |
512 } // namespace gpu | 513 } // namespace gpu |
513 | 514 |
514 | 515 |
OLD | NEW |