| 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_MEMORY_PROGRAM_CACHE_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_MEMORY_PROGRAM_CACHE_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_MEMORY_PROGRAM_CACHE_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_MEMORY_PROGRAM_CACHE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 MemoryProgramCache(); | 24 MemoryProgramCache(); |
| 25 explicit MemoryProgramCache(const size_t max_cache_size_bytes); | 25 explicit MemoryProgramCache(const size_t max_cache_size_bytes); |
| 26 ~MemoryProgramCache() override; | 26 ~MemoryProgramCache() override; |
| 27 | 27 |
| 28 ProgramLoadResult LoadLinkedProgram( | 28 ProgramLoadResult LoadLinkedProgram( |
| 29 GLuint program, | 29 GLuint program, |
| 30 Shader* shader_a, | 30 Shader* shader_a, |
| 31 Shader* shader_b, | 31 Shader* shader_b, |
| 32 const LocationMap* bind_attrib_location_map, | 32 const LocationMap* bind_attrib_location_map, |
| 33 const std::vector<std::string>& transform_feedback_varyings, |
| 34 GLenum transform_feedback_buffer_mode, |
| 33 const ShaderCacheCallback& shader_callback) override; | 35 const ShaderCacheCallback& shader_callback) override; |
| 34 void SaveLinkedProgram(GLuint program, | 36 void SaveLinkedProgram( |
| 35 const Shader* shader_a, | 37 GLuint program, |
| 36 const Shader* shader_b, | 38 const Shader* shader_a, |
| 37 const LocationMap* bind_attrib_location_map, | 39 const Shader* shader_b, |
| 38 const ShaderCacheCallback& shader_callback) override; | 40 const LocationMap* bind_attrib_location_map, |
| 41 const std::vector<std::string>& transform_feedback_varyings, |
| 42 GLenum transform_feedback_buffer_mode, |
| 43 const ShaderCacheCallback& shader_callback) override; |
| 39 | 44 |
| 40 void LoadProgram(const std::string& program) override; | 45 void LoadProgram(const std::string& program) override; |
| 41 | 46 |
| 42 private: | 47 private: |
| 43 void ClearBackend() override; | 48 void ClearBackend() override; |
| 44 | 49 |
| 45 class ProgramCacheValue : public base::RefCounted<ProgramCacheValue> { | 50 class ProgramCacheValue : public base::RefCounted<ProgramCacheValue> { |
| 46 public: | 51 public: |
| 47 ProgramCacheValue(GLsizei length, | 52 ProgramCacheValue(GLsizei length, |
| 48 GLenum format, | 53 GLenum format, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 size_t curr_size_bytes_; | 138 size_t curr_size_bytes_; |
| 134 ProgramMRUCache store_; | 139 ProgramMRUCache store_; |
| 135 | 140 |
| 136 DISALLOW_COPY_AND_ASSIGN(MemoryProgramCache); | 141 DISALLOW_COPY_AND_ASSIGN(MemoryProgramCache); |
| 137 }; | 142 }; |
| 138 | 143 |
| 139 } // namespace gles2 | 144 } // namespace gles2 |
| 140 } // namespace gpu | 145 } // namespace gpu |
| 141 | 146 |
| 142 #endif // GPU_COMMAND_BUFFER_SERVICE_MEMORY_PROGRAM_CACHE_H_ | 147 #endif // GPU_COMMAND_BUFFER_SERVICE_MEMORY_PROGRAM_CACHE_H_ |
| OLD | NEW |