Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(748)

Side by Side Diff: gpu/command_buffer/client/transfer_buffer.h

Issue 1859703002: convert //gpu to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/share_group.h ('k') | gpu/command_buffer/client/transfer_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698