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> |
| 9 #include <stdint.h> |
| 10 |
8 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
10 #include "gpu/command_buffer/client/ring_buffer.h" | 14 #include "gpu/command_buffer/client/ring_buffer.h" |
11 #include "gpu/command_buffer/common/buffer.h" | 15 #include "gpu/command_buffer/common/buffer.h" |
12 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 16 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
13 #include "gpu/gpu_export.h" | 17 #include "gpu/gpu_export.h" |
14 | 18 |
15 namespace gpu { | 19 namespace gpu { |
16 | 20 |
17 class CommandBufferHelper; | 21 class CommandBufferHelper; |
18 | 22 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // Size at which to do an async flush. 0 = never. | 117 // Size at which to do an async flush. 0 = never. |
114 unsigned int size_to_flush_; | 118 unsigned int size_to_flush_; |
115 | 119 |
116 // Number of bytes since we last flushed. | 120 // Number of bytes since we last flushed. |
117 unsigned int bytes_since_last_flush_; | 121 unsigned int bytes_since_last_flush_; |
118 | 122 |
119 // the current buffer. | 123 // the current buffer. |
120 scoped_refptr<gpu::Buffer> buffer_; | 124 scoped_refptr<gpu::Buffer> buffer_; |
121 | 125 |
122 // id of buffer. -1 = no buffer | 126 // id of buffer. -1 = no buffer |
123 int32 buffer_id_; | 127 int32_t buffer_id_; |
124 | 128 |
125 // address of result area | 129 // address of result area |
126 void* result_buffer_; | 130 void* result_buffer_; |
127 | 131 |
128 // offset to result area | 132 // offset to result area |
129 uint32 result_shm_offset_; | 133 uint32_t result_shm_offset_; |
130 | 134 |
131 // false if we failed to allocate min_buffer_size | 135 // false if we failed to allocate min_buffer_size |
132 bool usable_; | 136 bool usable_; |
133 }; | 137 }; |
134 | 138 |
135 // A class that will manage the lifetime of a transferbuffer allocation. | 139 // A class that will manage the lifetime of a transferbuffer allocation. |
136 class GPU_EXPORT ScopedTransferBufferPtr { | 140 class GPU_EXPORT ScopedTransferBufferPtr { |
137 public: | 141 public: |
138 ScopedTransferBufferPtr( | 142 ScopedTransferBufferPtr( |
139 unsigned int size, | 143 unsigned int size, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } | 211 } |
208 | 212 |
209 unsigned int num_elements() const { | 213 unsigned int num_elements() const { |
210 return size() / sizeof(T); | 214 return size() / sizeof(T); |
211 } | 215 } |
212 }; | 216 }; |
213 | 217 |
214 } // namespace gpu | 218 } // namespace gpu |
215 | 219 |
216 #endif // GPU_COMMAND_BUFFER_CLIENT_TRANSFER_BUFFER_H_ | 220 #endif // GPU_COMMAND_BUFFER_CLIENT_TRANSFER_BUFFER_H_ |
OLD | NEW |