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 11 matching lines...) Expand all Loading... |
22 class GPU_EXPORT MemoryProgramCache : public ProgramCache { | 22 class GPU_EXPORT MemoryProgramCache : public ProgramCache { |
23 public: | 23 public: |
24 static const size_t kDefaultMaxProgramCacheMemoryBytes = 6 * 1024 * 1024; | 24 static const size_t kDefaultMaxProgramCacheMemoryBytes = 6 * 1024 * 1024; |
25 | 25 |
26 MemoryProgramCache(); | 26 MemoryProgramCache(); |
27 explicit MemoryProgramCache(const size_t max_cache_size_bytes); | 27 explicit MemoryProgramCache(const size_t max_cache_size_bytes); |
28 virtual ~MemoryProgramCache(); | 28 virtual ~MemoryProgramCache(); |
29 | 29 |
30 virtual ProgramLoadResult LoadLinkedProgram( | 30 virtual ProgramLoadResult LoadLinkedProgram( |
31 GLuint program, | 31 GLuint program, |
32 ShaderManager::ShaderInfo* shader_a, | 32 Shader* shader_a, |
33 ShaderManager::ShaderInfo* shader_b, | 33 Shader* shader_b, |
34 const LocationMap* bind_attrib_location_map) const OVERRIDE; | 34 const LocationMap* bind_attrib_location_map) const OVERRIDE; |
35 virtual void SaveLinkedProgram( | 35 virtual void SaveLinkedProgram( |
36 GLuint program, | 36 GLuint program, |
37 const ShaderManager::ShaderInfo* shader_a, | 37 const Shader* shader_a, |
38 const ShaderManager::ShaderInfo* shader_b, | 38 const Shader* shader_b, |
39 const LocationMap* bind_attrib_location_map) OVERRIDE; | 39 const LocationMap* bind_attrib_location_map) OVERRIDE; |
40 | 40 |
41 private: | 41 private: |
42 virtual void ClearBackend() OVERRIDE; | 42 virtual void ClearBackend() OVERRIDE; |
43 | 43 |
44 struct ProgramCacheValue : public base::RefCounted<ProgramCacheValue> { | 44 struct ProgramCacheValue : public base::RefCounted<ProgramCacheValue> { |
45 public: | 45 public: |
46 ProgramCacheValue(GLsizei _length, | 46 ProgramCacheValue(GLsizei _length, |
47 GLenum _format, | 47 GLenum _format, |
48 const char* _data, | 48 const char* _data, |
(...skipping 29 matching lines...) Expand all Loading... |
78 StoreMap store_; | 78 StoreMap store_; |
79 ProgramCacheLruHelper eviction_helper_; | 79 ProgramCacheLruHelper eviction_helper_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(MemoryProgramCache); | 81 DISALLOW_COPY_AND_ASSIGN(MemoryProgramCache); |
82 }; | 82 }; |
83 | 83 |
84 } // namespace gles2 | 84 } // namespace gles2 |
85 } // namespace gpu | 85 } // namespace gpu |
86 | 86 |
87 #endif // GPU_COMMAND_BUFFER_SERVICE_MEMORY_PROGRAM_CACHE_H_ | 87 #endif // GPU_COMMAND_BUFFER_SERVICE_MEMORY_PROGRAM_CACHE_H_ |
OLD | NEW |