Chromium Code Reviews| 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/program_manager.h" | 5 #include "gpu/command_buffer/service/program_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 return false; | 73 return false; |
| 74 } | 74 } |
| 75 | 75 |
| 76 GLint index = 0; | 76 GLint index = 0; |
| 77 size_t last = name.size() - 1; | 77 size_t last = name.size() - 1; |
| 78 for (size_t pos = open_pos + 1; pos < last; ++pos) { | 78 for (size_t pos = open_pos + 1; pos < last; ++pos) { |
| 79 int8 digit = name[pos] - '0'; | 79 int8 digit = name[pos] - '0'; |
| 80 if (digit < 0 || digit > 9) { | 80 if (digit < 0 || digit > 9) { |
| 81 return false; | 81 return false; |
| 82 } | 82 } |
| 83 index = index * 10 + digit; | 83 index = (GLint) digit; |
|
Tyler Breisacher (Chromium)
2012/07/25 17:47:19
Why are you removing the "index * 10 +" part?
| |
| 84 } | |
| 85 | |
| 86 if (index < 0) { | |
| 87 return false; | |
| 88 } | 84 } |
| 89 | 85 |
| 90 *element_index = index; | 86 *element_index = index; |
| 91 *new_name = name.substr(0, open_pos); | 87 *new_name = name.substr(0, open_pos); |
| 92 return true; | 88 return true; |
| 93 } | 89 } |
| 94 | 90 |
| 95 } // anonymous namespace. | 91 } // anonymous namespace. |
| 96 | 92 |
| 97 ProgramManager::ProgramInfo::UniformInfo::UniformInfo() | 93 ProgramManager::ProgramInfo::UniformInfo::UniformInfo() |
| (...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1116 } | 1112 } |
| 1117 | 1113 |
| 1118 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) { | 1114 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) { |
| 1119 return index + element * 0x10000; | 1115 return index + element * 0x10000; |
| 1120 } | 1116 } |
| 1121 | 1117 |
| 1122 } // namespace gles2 | 1118 } // namespace gles2 |
| 1123 } // namespace gpu | 1119 } // namespace gpu |
| 1124 | 1120 |
| 1125 | 1121 |
| OLD | NEW |