| 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 #include "gpu/command_buffer/service/common_decoder.h" | 5 #include "gpu/command_buffer/service/common_decoder.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 const cmd::GetBucketStart& args = | 274 const cmd::GetBucketStart& args = |
| 275 *static_cast<const cmd::GetBucketStart*>(cmd_data); | 275 *static_cast<const cmd::GetBucketStart*>(cmd_data); |
| 276 uint32_t bucket_id = args.bucket_id; | 276 uint32_t bucket_id = args.bucket_id; |
| 277 uint32_t* result = GetSharedMemoryAs<uint32_t*>( | 277 uint32_t* result = GetSharedMemoryAs<uint32_t*>( |
| 278 args.result_memory_id, args.result_memory_offset, sizeof(*result)); | 278 args.result_memory_id, args.result_memory_offset, sizeof(*result)); |
| 279 int32_t data_memory_id = args.data_memory_id; | 279 int32_t data_memory_id = args.data_memory_id; |
| 280 uint32_t data_memory_offset = args.data_memory_offset; | 280 uint32_t data_memory_offset = args.data_memory_offset; |
| 281 uint32_t data_memory_size = args.data_memory_size; | 281 uint32_t data_memory_size = args.data_memory_size; |
| 282 uint8_t* data = NULL; | 282 uint8_t* data = NULL; |
| 283 if (data_memory_size != 0 || data_memory_id != 0 || data_memory_offset != 0) { | 283 if (data_memory_size != 0 || data_memory_id != 0 || data_memory_offset != 0) { |
| 284 data = GetSharedMemoryAs<uint8_t*>( | 284 data = GetSharedMemoryAs<uint8_t*>(data_memory_id, data_memory_offset, |
| 285 args.data_memory_id, args.data_memory_offset, args.data_memory_size); | 285 data_memory_size); |
| 286 if (!data) { | 286 if (!data) { |
| 287 return error::kInvalidArguments; | 287 return error::kInvalidArguments; |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 if (!result) { | 290 if (!result) { |
| 291 return error::kInvalidArguments; | 291 return error::kInvalidArguments; |
| 292 } | 292 } |
| 293 // Check that the client initialized the result. | 293 // Check that the client initialized the result. |
| 294 if (*result != 0) { | 294 if (*result != 0) { |
| 295 return error::kInvalidArguments; | 295 return error::kInvalidArguments; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 325 } | 325 } |
| 326 const void* src = bucket->GetData(offset, size); | 326 const void* src = bucket->GetData(offset, size); |
| 327 if (!src) { | 327 if (!src) { |
| 328 return error::kInvalidArguments; | 328 return error::kInvalidArguments; |
| 329 } | 329 } |
| 330 memcpy(data, src, size); | 330 memcpy(data, src, size); |
| 331 return error::kNoError; | 331 return error::kNoError; |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace gpu | 334 } // namespace gpu |
| OLD | NEW |