| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
| 11 #include <string> | 12 #include <string> |
| 12 | 13 |
| 13 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
| 14 #include "base/containers/mru_cache.h" | 15 #include "base/containers/mru_cache.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | |
| 18 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 18 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 19 #include "gpu/command_buffer/service/program_cache.h" | 19 #include "gpu/command_buffer/service/program_cache.h" |
| 20 | 20 |
| 21 namespace gpu { | 21 namespace gpu { |
| 22 | 22 |
| 23 struct GpuPreferences; | 23 struct GpuPreferences; |
| 24 | 24 |
| 25 namespace gles2 { | 25 namespace gles2 { |
| 26 | 26 |
| 27 // Program cache that stores binaries completely in-memory | 27 // Program cache that stores binaries completely in-memory |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 return output_variable_list_1_; | 123 return output_variable_list_1_; |
| 124 } | 124 } |
| 125 | 125 |
| 126 private: | 126 private: |
| 127 friend class base::RefCounted<ProgramCacheValue>; | 127 friend class base::RefCounted<ProgramCacheValue>; |
| 128 | 128 |
| 129 ~ProgramCacheValue(); | 129 ~ProgramCacheValue(); |
| 130 | 130 |
| 131 const GLsizei length_; | 131 const GLsizei length_; |
| 132 const GLenum format_; | 132 const GLenum format_; |
| 133 const scoped_ptr<const char[]> data_; | 133 const std::unique_ptr<const char[]> data_; |
| 134 const std::string program_hash_; | 134 const std::string program_hash_; |
| 135 const std::string shader_0_hash_; | 135 const std::string shader_0_hash_; |
| 136 const AttributeMap attrib_map_0_; | 136 const AttributeMap attrib_map_0_; |
| 137 const UniformMap uniform_map_0_; | 137 const UniformMap uniform_map_0_; |
| 138 const VaryingMap varying_map_0_; | 138 const VaryingMap varying_map_0_; |
| 139 const OutputVariableList output_variable_list_0_; | 139 const OutputVariableList output_variable_list_0_; |
| 140 const std::string shader_1_hash_; | 140 const std::string shader_1_hash_; |
| 141 const AttributeMap attrib_map_1_; | 141 const AttributeMap attrib_map_1_; |
| 142 const UniformMap uniform_map_1_; | 142 const UniformMap uniform_map_1_; |
| 143 const VaryingMap varying_map_1_; | 143 const VaryingMap varying_map_1_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 157 size_t curr_size_bytes_; | 157 size_t curr_size_bytes_; |
| 158 ProgramMRUCache store_; | 158 ProgramMRUCache store_; |
| 159 | 159 |
| 160 DISALLOW_COPY_AND_ASSIGN(MemoryProgramCache); | 160 DISALLOW_COPY_AND_ASSIGN(MemoryProgramCache); |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 } // namespace gles2 | 163 } // namespace gles2 |
| 164 } // namespace gpu | 164 } // namespace gpu |
| 165 | 165 |
| 166 #endif // GPU_COMMAND_BUFFER_SERVICE_MEMORY_PROGRAM_CACHE_H_ | 166 #endif // GPU_COMMAND_BUFFER_SERVICE_MEMORY_PROGRAM_CACHE_H_ |
| OLD | NEW |