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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 NOTREACHED() << "Unhandled UniformInfo type " << type; | 244 NOTREACHED() << "Unhandled UniformInfo type " << type; |
245 break; | 245 break; |
246 } | 246 } |
247 DCHECK_LT(0, size); | 247 DCHECK_LT(0, size); |
248 DCHECK(is_array || size == 1); | 248 DCHECK(is_array || size == 1); |
249 | 249 |
250 size_t num_texture_units = IsSampler() ? static_cast<size_t>(size) : 0u; | 250 size_t num_texture_units = IsSampler() ? static_cast<size_t>(size) : 0u; |
251 texture_units.clear(); | 251 texture_units.clear(); |
252 texture_units.resize(num_texture_units, 0); | 252 texture_units.resize(num_texture_units, 0); |
253 } | 253 } |
| 254 |
| 255 Program::UniformInfo::UniformInfo(const UniformInfo& other) = default; |
| 256 |
254 Program::UniformInfo::~UniformInfo() {} | 257 Program::UniformInfo::~UniformInfo() {} |
255 | 258 |
256 bool ProgramManager::HasBuiltInPrefix(const std::string& name) { | 259 bool ProgramManager::HasBuiltInPrefix(const std::string& name) { |
257 return name.length() >= 3 && name[0] == 'g' && name[1] == 'l' && | 260 return name.length() >= 3 && name[0] == 'g' && name[1] == 'l' && |
258 name[2] == '_'; | 261 name[2] == '_'; |
259 } | 262 } |
260 | 263 |
261 Program::Program(ProgramManager* manager, GLuint service_id) | 264 Program::Program(ProgramManager* manager, GLuint service_id) |
262 : manager_(manager), | 265 : manager_(manager), |
263 use_count_(0), | 266 use_count_(0), |
(...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2364 DCHECK(program); | 2367 DCHECK(program); |
2365 program->ClearUniforms(&zero_); | 2368 program->ClearUniforms(&zero_); |
2366 } | 2369 } |
2367 | 2370 |
2368 int32_t ProgramManager::MakeFakeLocation(int32_t index, int32_t element) { | 2371 int32_t ProgramManager::MakeFakeLocation(int32_t index, int32_t element) { |
2369 return index + element * 0x10000; | 2372 return index + element * 0x10000; |
2370 } | 2373 } |
2371 | 2374 |
2372 } // namespace gles2 | 2375 } // namespace gles2 |
2373 } // namespace gpu | 2376 } // namespace gpu |
OLD | NEW |