| 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_CACHE_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_CACHE_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_CACHE_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_CACHE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 LinkedProgramStatus GetLinkedProgramStatus( | 48 LinkedProgramStatus GetLinkedProgramStatus( |
| 49 const std::string& untranslated_a, | 49 const std::string& untranslated_a, |
| 50 const std::string& untranslated_b, | 50 const std::string& untranslated_b, |
| 51 const LocationMap* bind_attrib_location_map) const; | 51 const LocationMap* bind_attrib_location_map) const; |
| 52 | 52 |
| 53 // Loads the linked program from the cache. If the program is not found or | 53 // Loads the linked program from the cache. If the program is not found or |
| 54 // there was an error, PROGRAM_LOAD_FAILURE should be returned. | 54 // there was an error, PROGRAM_LOAD_FAILURE should be returned. |
| 55 virtual ProgramLoadResult LoadLinkedProgram( | 55 virtual ProgramLoadResult LoadLinkedProgram( |
| 56 GLuint program, | 56 GLuint program, |
| 57 ShaderManager::ShaderInfo* shader_a, | 57 Shader* shader_a, |
| 58 ShaderManager::ShaderInfo* shader_b, | 58 Shader* shader_b, |
| 59 const LocationMap* bind_attrib_location_map) const = 0; | 59 const LocationMap* bind_attrib_location_map) const = 0; |
| 60 | 60 |
| 61 // Saves the program into the cache. If successful, the implementation should | 61 // Saves the program into the cache. If successful, the implementation should |
| 62 // call LinkedProgramCacheSuccess. | 62 // call LinkedProgramCacheSuccess. |
| 63 virtual void SaveLinkedProgram( | 63 virtual void SaveLinkedProgram( |
| 64 GLuint program, | 64 GLuint program, |
| 65 const ShaderManager::ShaderInfo* shader_a, | 65 const Shader* shader_a, |
| 66 const ShaderManager::ShaderInfo* shader_b, | 66 const Shader* shader_b, |
| 67 const LocationMap* bind_attrib_location_map) = 0; | 67 const LocationMap* bind_attrib_location_map) = 0; |
| 68 | 68 |
| 69 // clears the cache | 69 // clears the cache |
| 70 void Clear(); | 70 void Clear(); |
| 71 | 71 |
| 72 // Only for testing | 72 // Only for testing |
| 73 void LinkedProgramCacheSuccess(const std::string& shader_a, | 73 void LinkedProgramCacheSuccess(const std::string& shader_a, |
| 74 const std::string& shader_b, | 74 const std::string& shader_b, |
| 75 const LocationMap* bind_attrib_location_map); | 75 const LocationMap* bind_attrib_location_map); |
| 76 | 76 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 CompileStatusMap shader_status_; | 118 CompileStatusMap shader_status_; |
| 119 LinkStatusMap link_status_; | 119 LinkStatusMap link_status_; |
| 120 | 120 |
| 121 DISALLOW_COPY_AND_ASSIGN(ProgramCache); | 121 DISALLOW_COPY_AND_ASSIGN(ProgramCache); |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace gles2 | 124 } // namespace gles2 |
| 125 } // namespace gpu | 125 } // namespace gpu |
| 126 | 126 |
| 127 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_CACHE_H_ | 127 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_CACHE_H_ |
| OLD | NEW |