| 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_BUFFER_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 // A copy of the data in the buffer. This data is only kept if the target | 153 // A copy of the data in the buffer. This data is only kept if the target |
| 154 // is backed_ = true. | 154 // is backed_ = true. |
| 155 scoped_array<int8> shadow_; | 155 scoped_array<int8> shadow_; |
| 156 | 156 |
| 157 // A map of ranges to the highest value in that range of a certain type. | 157 // A map of ranges to the highest value in that range of a certain type. |
| 158 typedef std::map<Range, GLuint, Range::Less> RangeToMaxValueMap; | 158 typedef std::map<Range, GLuint, Range::Less> RangeToMaxValueMap; |
| 159 RangeToMaxValueMap range_set_; | 159 RangeToMaxValueMap range_set_; |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 BufferManager(MemoryTracker* memory_tracker); | 162 explicit BufferManager(MemoryTracker* memory_tracker); |
| 163 ~BufferManager(); | 163 ~BufferManager(); |
| 164 | 164 |
| 165 // Must call before destruction. | 165 // Must call before destruction. |
| 166 void Destroy(bool have_context); | 166 void Destroy(bool have_context); |
| 167 | 167 |
| 168 // Creates a BufferInfo for the given buffer. | 168 // Creates a BufferInfo for the given buffer. |
| 169 void CreateBufferInfo(GLuint client_id, GLuint service_id); | 169 void CreateBufferInfo(GLuint client_id, GLuint service_id); |
| 170 | 170 |
| 171 // Gets the buffer info for the given buffer. | 171 // Gets the buffer info for the given buffer. |
| 172 BufferInfo* GetBufferInfo(GLuint client_id); | 172 BufferInfo* GetBufferInfo(GLuint client_id); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 bool have_context_; | 211 bool have_context_; |
| 212 | 212 |
| 213 DISALLOW_COPY_AND_ASSIGN(BufferManager); | 213 DISALLOW_COPY_AND_ASSIGN(BufferManager); |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 } // namespace gles2 | 216 } // namespace gles2 |
| 217 } // namespace gpu | 217 } // namespace gpu |
| 218 | 218 |
| 219 #endif // GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_ | 219 #endif // GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_ |
| OLD | NEW |