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 // This file contains the command buffer helper class. | 5 // This file contains the command buffer helper class. |
6 | 6 |
7 #ifndef GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ | 7 #ifndef GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ |
8 #define GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ | 8 #define GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ |
9 | 9 |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 void SetBucketDataImmediate( | 202 void SetBucketDataImmediate( |
203 uint32 bucket_id, uint32 offset, const void* data, uint32 size) { | 203 uint32 bucket_id, uint32 offset, const void* data, uint32 size) { |
204 cmd::SetBucketDataImmediate* cmd = | 204 cmd::SetBucketDataImmediate* cmd = |
205 GetImmediateCmdSpace<cmd::SetBucketDataImmediate>(size); | 205 GetImmediateCmdSpace<cmd::SetBucketDataImmediate>(size); |
206 if (cmd) { | 206 if (cmd) { |
207 cmd->Init(bucket_id, offset, size); | 207 cmd->Init(bucket_id, offset, size); |
208 memcpy(ImmediateDataAddress(cmd), data, size); | 208 memcpy(ImmediateDataAddress(cmd), data, size); |
209 } | 209 } |
210 } | 210 } |
211 | 211 |
212 void GetBucketSize(uint32 bucket_id, | 212 void GetBucketStart(uint32 bucket_id, |
213 uint32 shared_memory_id, | 213 uint32 result_memory_id, |
214 uint32 shared_memory_offset) { | 214 uint32 result_memory_offset, |
215 cmd::GetBucketSize* cmd = GetCmdSpace<cmd::GetBucketSize>(); | 215 uint32 data_memory_size, |
| 216 uint32 data_memory_id, |
| 217 uint32 data_memory_offset) { |
| 218 cmd::GetBucketStart* cmd = GetCmdSpace<cmd::GetBucketStart>(); |
216 if (cmd) { | 219 if (cmd) { |
217 cmd->Init(bucket_id, | 220 cmd->Init(bucket_id, |
218 shared_memory_id, | 221 result_memory_id, |
219 shared_memory_offset); | 222 result_memory_offset, |
| 223 data_memory_size, |
| 224 data_memory_id, |
| 225 data_memory_offset); |
220 } | 226 } |
221 } | 227 } |
222 | 228 |
223 void GetBucketData(uint32 bucket_id, | 229 void GetBucketData(uint32 bucket_id, |
224 uint32 offset, | 230 uint32 offset, |
225 uint32 size, | 231 uint32 size, |
226 uint32 shared_memory_id, | 232 uint32 shared_memory_id, |
227 uint32 shared_memory_offset) { | 233 uint32 shared_memory_offset) { |
228 cmd::GetBucketData* cmd = GetCmdSpace<cmd::GetBucketData>(); | 234 cmd::GetBucketData* cmd = GetCmdSpace<cmd::GetBucketData>(); |
229 if (cmd) { | 235 if (cmd) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 // Using C runtime instead of base because this file cannot depend on base. | 291 // Using C runtime instead of base because this file cannot depend on base. |
286 clock_t last_flush_time_; | 292 clock_t last_flush_time_; |
287 | 293 |
288 friend class CommandBufferHelperTest; | 294 friend class CommandBufferHelperTest; |
289 DISALLOW_COPY_AND_ASSIGN(CommandBufferHelper); | 295 DISALLOW_COPY_AND_ASSIGN(CommandBufferHelper); |
290 }; | 296 }; |
291 | 297 |
292 } // namespace gpu | 298 } // namespace gpu |
293 | 299 |
294 #endif // GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ | 300 #endif // GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ |
OLD | NEW |