| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 bool SetTarget(Buffer* buffer, GLenum target); | 212 bool SetTarget(Buffer* buffer, GLenum target); |
| 213 | 213 |
| 214 void set_allow_buffers_on_multiple_targets(bool allow) { | 214 void set_allow_buffers_on_multiple_targets(bool allow) { |
| 215 allow_buffers_on_multiple_targets_ = allow; | 215 allow_buffers_on_multiple_targets_ = allow; |
| 216 } | 216 } |
| 217 | 217 |
| 218 size_t mem_represented() const { | 218 size_t mem_represented() const { |
| 219 return memory_tracker_->GetMemRepresented(); | 219 return memory_tracker_->GetMemRepresented(); |
| 220 } | 220 } |
| 221 | 221 |
| 222 // Tell's for a given usage if this would be a client side array. | 222 // Tells for a given usage if this would be a client side array. |
| 223 bool IsUsageClientSideArray(GLenum usage); | 223 bool IsUsageClientSideArray(GLenum usage); |
| 224 | 224 |
| 225 // Tells whether a buffer that is emulated using client-side arrays should be |
| 226 // set to a non-zero size. |
| 227 bool UseNonZeroSizeForClientSideArrayBuffer(); |
| 228 |
| 225 private: | 229 private: |
| 226 friend class Buffer; | 230 friend class Buffer; |
| 227 void StartTracking(Buffer* buffer); | 231 void StartTracking(Buffer* buffer); |
| 228 void StopTracking(Buffer* buffer); | 232 void StopTracking(Buffer* buffer); |
| 229 | 233 |
| 230 // Sets the size, usage and initial data of a buffer. | 234 // Sets the size, usage and initial data of a buffer. |
| 231 // If data is NULL buffer will be initialized to 0 if shadowed. | 235 // If data is NULL buffer will be initialized to 0 if shadowed. |
| 232 void SetInfo( | 236 void SetInfo( |
| 233 Buffer* buffer, GLsizeiptr size, GLenum usage, const GLvoid* data); | 237 Buffer* buffer, GLsizeiptr size, GLenum usage, const GLvoid* data); |
| 234 | 238 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 249 bool have_context_; | 253 bool have_context_; |
| 250 bool use_client_side_arrays_for_stream_buffers_; | 254 bool use_client_side_arrays_for_stream_buffers_; |
| 251 | 255 |
| 252 DISALLOW_COPY_AND_ASSIGN(BufferManager); | 256 DISALLOW_COPY_AND_ASSIGN(BufferManager); |
| 253 }; | 257 }; |
| 254 | 258 |
| 255 } // namespace gles2 | 259 } // namespace gles2 |
| 256 } // namespace gpu | 260 } // namespace gpu |
| 257 | 261 |
| 258 #endif // GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_ | 262 #endif // GPU_COMMAND_BUFFER_SERVICE_BUFFER_MANAGER_H_ |
| OLD | NEW |