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 15 matching lines...) Expand all Loading... |
26 explicit MemoryProgramCache(const size_t max_cache_size_bytes); | 26 explicit MemoryProgramCache(const size_t max_cache_size_bytes); |
27 virtual ~MemoryProgramCache(); | 27 virtual ~MemoryProgramCache(); |
28 | 28 |
29 virtual ProgramLoadResult LoadLinkedProgram( | 29 virtual ProgramLoadResult LoadLinkedProgram( |
30 GLuint program, | 30 GLuint program, |
31 Shader* shader_a, | 31 Shader* shader_a, |
32 const ShaderTranslatorInterface* translator_a, | 32 const ShaderTranslatorInterface* translator_a, |
33 Shader* shader_b, | 33 Shader* shader_b, |
34 const ShaderTranslatorInterface* translator_b, | 34 const ShaderTranslatorInterface* translator_b, |
35 const LocationMap* bind_attrib_location_map, | 35 const LocationMap* bind_attrib_location_map, |
36 const ShaderCacheCallback& shader_callback) OVERRIDE; | 36 const ShaderCacheCallback& shader_callback) override; |
37 virtual void SaveLinkedProgram( | 37 virtual void SaveLinkedProgram( |
38 GLuint program, | 38 GLuint program, |
39 const Shader* shader_a, | 39 const Shader* shader_a, |
40 const ShaderTranslatorInterface* translator_a, | 40 const ShaderTranslatorInterface* translator_a, |
41 const Shader* shader_b, | 41 const Shader* shader_b, |
42 const ShaderTranslatorInterface* translator_b, | 42 const ShaderTranslatorInterface* translator_b, |
43 const LocationMap* bind_attrib_location_map, | 43 const LocationMap* bind_attrib_location_map, |
44 const ShaderCacheCallback& shader_callback) OVERRIDE; | 44 const ShaderCacheCallback& shader_callback) override; |
45 | 45 |
46 virtual void LoadProgram(const std::string& program) OVERRIDE; | 46 virtual void LoadProgram(const std::string& program) override; |
47 | 47 |
48 private: | 48 private: |
49 virtual void ClearBackend() OVERRIDE; | 49 virtual void ClearBackend() override; |
50 | 50 |
51 class ProgramCacheValue : public base::RefCounted<ProgramCacheValue> { | 51 class ProgramCacheValue : public base::RefCounted<ProgramCacheValue> { |
52 public: | 52 public: |
53 ProgramCacheValue(GLsizei length, | 53 ProgramCacheValue(GLsizei length, |
54 GLenum format, | 54 GLenum format, |
55 const char* data, | 55 const char* data, |
56 const std::string& program_hash, | 56 const std::string& program_hash, |
57 const char* shader_0_hash, | 57 const char* shader_0_hash, |
58 const ShaderTranslator::VariableMap& attrib_map_0, | 58 const ShaderTranslator::VariableMap& attrib_map_0, |
59 const ShaderTranslator::VariableMap& uniform_map_0, | 59 const ShaderTranslator::VariableMap& uniform_map_0, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 size_t curr_size_bytes_; | 139 size_t curr_size_bytes_; |
140 ProgramMRUCache store_; | 140 ProgramMRUCache store_; |
141 | 141 |
142 DISALLOW_COPY_AND_ASSIGN(MemoryProgramCache); | 142 DISALLOW_COPY_AND_ASSIGN(MemoryProgramCache); |
143 }; | 143 }; |
144 | 144 |
145 } // namespace gles2 | 145 } // namespace gles2 |
146 } // namespace gpu | 146 } // namespace gpu |
147 | 147 |
148 #endif // GPU_COMMAND_BUFFER_SERVICE_MEMORY_PROGRAM_CACHE_H_ | 148 #endif // GPU_COMMAND_BUFFER_SERVICE_MEMORY_PROGRAM_CACHE_H_ |
OLD | NEW |