| 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_CLIENT_TRANSFER_BUFFER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_TRANSFER_BUFFER_H_ |
| 6 #define GPU_COMMAND_BUFFER_CLIENT_TRANSFER_BUFFER_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_TRANSFER_BUFFER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> |
| 12 |
| 11 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 14 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "gpu/command_buffer/client/ring_buffer.h" | 15 #include "gpu/command_buffer/client/ring_buffer.h" |
| 15 #include "gpu/command_buffer/common/buffer.h" | 16 #include "gpu/command_buffer/common/buffer.h" |
| 16 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 17 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 17 #include "gpu/gpu_export.h" | 18 #include "gpu/gpu_export.h" |
| 18 | 19 |
| 19 namespace gpu { | 20 namespace gpu { |
| 20 | 21 |
| 21 class CommandBufferHelper; | 22 class CommandBufferHelper; |
| 22 | 23 |
| 23 // Interface for managing the transfer buffer. | 24 // Interface for managing the transfer buffer. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 unsigned int GetCurrentMaxAllocationWithoutRealloc() const; | 91 unsigned int GetCurrentMaxAllocationWithoutRealloc() const; |
| 91 unsigned int GetMaxAllocation() const; | 92 unsigned int GetMaxAllocation() const; |
| 92 | 93 |
| 93 private: | 94 private: |
| 94 // Tries to reallocate the ring buffer if it's not large enough for size. | 95 // Tries to reallocate the ring buffer if it's not large enough for size. |
| 95 void ReallocateRingBuffer(unsigned int size); | 96 void ReallocateRingBuffer(unsigned int size); |
| 96 | 97 |
| 97 void AllocateRingBuffer(unsigned int size); | 98 void AllocateRingBuffer(unsigned int size); |
| 98 | 99 |
| 99 CommandBufferHelper* helper_; | 100 CommandBufferHelper* helper_; |
| 100 scoped_ptr<RingBuffer> ring_buffer_; | 101 std::unique_ptr<RingBuffer> ring_buffer_; |
| 101 | 102 |
| 102 // size reserved for results | 103 // size reserved for results |
| 103 unsigned int result_size_; | 104 unsigned int result_size_; |
| 104 | 105 |
| 105 // default size. Size we want when starting or re-allocating | 106 // default size. Size we want when starting or re-allocating |
| 106 unsigned int default_buffer_size_; | 107 unsigned int default_buffer_size_; |
| 107 | 108 |
| 108 // min size we'll consider successful | 109 // min size we'll consider successful |
| 109 unsigned int min_buffer_size_; | 110 unsigned int min_buffer_size_; |
| 110 | 111 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 } | 212 } |
| 212 | 213 |
| 213 unsigned int num_elements() const { | 214 unsigned int num_elements() const { |
| 214 return size() / sizeof(T); | 215 return size() / sizeof(T); |
| 215 } | 216 } |
| 216 }; | 217 }; |
| 217 | 218 |
| 218 } // namespace gpu | 219 } // namespace gpu |
| 219 | 220 |
| 220 #endif // GPU_COMMAND_BUFFER_CLIENT_TRANSFER_BUFFER_H_ | 221 #endif // GPU_COMMAND_BUFFER_CLIENT_TRANSFER_BUFFER_H_ |
| OLD | NEW |