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 #ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 bool IsOwned(ProgramInfo* info); | 345 bool IsOwned(ProgramInfo* info); |
346 | 346 |
347 static int32 MakeFakeLocation(int32 index, int32 element); | 347 static int32 MakeFakeLocation(int32 index, int32 element); |
348 | 348 |
349 // Cache-aware shader compiling. If no cache or if the shader wasn't | 349 // Cache-aware shader compiling. If no cache or if the shader wasn't |
350 // previously compiled, ForceCompileShader is called | 350 // previously compiled, ForceCompileShader is called |
351 void DoCompileShader(ShaderManager::ShaderInfo* info, | 351 void DoCompileShader(ShaderManager::ShaderInfo* info, |
352 ShaderTranslator* translator, | 352 ShaderTranslator* translator, |
353 FeatureInfo* feature_info); | 353 FeatureInfo* feature_info); |
354 | 354 |
355 private: | |
356 // Actually compiles the shader | 355 // Actually compiles the shader |
357 void ForceCompileShader(const std::string* source, | 356 void ForceCompileShader(const std::string* source, |
358 ShaderManager::ShaderInfo* info, | 357 ShaderManager::ShaderInfo* info, |
359 ShaderTranslator* translator, | 358 ShaderTranslator* translator, |
360 FeatureInfo* feature_info); | 359 FeatureInfo* feature_info); |
361 | 360 |
| 361 private: |
362 void StartTracking(ProgramInfo* info); | 362 void StartTracking(ProgramInfo* info); |
363 void StopTracking(ProgramInfo* info); | 363 void StopTracking(ProgramInfo* info); |
364 | 364 |
365 // Info for each "successfully linked" program by service side program Id. | 365 // Info for each "successfully linked" program by service side program Id. |
366 // TODO(gman): Choose a faster container. | 366 // TODO(gman): Choose a faster container. |
367 typedef std::map<GLuint, ProgramInfo::Ref> ProgramInfoMap; | 367 typedef std::map<GLuint, ProgramInfo::Ref> ProgramInfoMap; |
368 ProgramInfoMap program_infos_; | 368 ProgramInfoMap program_infos_; |
369 | 369 |
370 // Counts the number of ProgramInfo allocated with 'this' as its manager. | 370 // Counts the number of ProgramInfo allocated with 'this' as its manager. |
371 // Allows to check no ProgramInfo will outlive this. | 371 // Allows to check no ProgramInfo will outlive this. |
(...skipping 11 matching lines...) Expand all Loading... |
383 void RemoveProgramInfoIfUnused( | 383 void RemoveProgramInfoIfUnused( |
384 ShaderManager* shader_manager, ProgramInfo* info); | 384 ShaderManager* shader_manager, ProgramInfo* info); |
385 | 385 |
386 DISALLOW_COPY_AND_ASSIGN(ProgramManager); | 386 DISALLOW_COPY_AND_ASSIGN(ProgramManager); |
387 }; | 387 }; |
388 | 388 |
389 } // namespace gles2 | 389 } // namespace gles2 |
390 } // namespace gpu | 390 } // namespace gpu |
391 | 391 |
392 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 392 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
OLD | NEW |