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

Side by Side Diff: gpu/command_buffer/service/common_decoder.cc

Issue 1843663007: gpu: Pull some variables onto the stack in the decoder CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:wi… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698