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

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

Issue 492009: First batch of GCC fixes for GPU code. (Closed)
Patch Set: Minor fixes Created 11 years 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 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 parse_error::ParseError CommandParser::ProcessCommand() { 67 parse_error::ParseError CommandParser::ProcessCommand() {
68 CommandBufferOffset get = get_; 68 CommandBufferOffset get = get_;
69 if (get == put_) return parse_error::kParseNoError; 69 if (get == put_) return parse_error::kParseNoError;
70 70
71 CommandHeader header = buffer_[get].value_header; 71 CommandHeader header = buffer_[get].value_header;
72 if (header.size == 0) { 72 if (header.size == 0) {
73 DLOG(INFO) << "Error: zero sized command in command buffer"; 73 DLOG(INFO) << "Error: zero sized command in command buffer";
74 return parse_error::kParseInvalidSize; 74 return parse_error::kParseInvalidSize;
75 } 75 }
76 76
77 if (header.size + get > entry_count_) { 77 if (static_cast<size_t>(header.size + get) > entry_count_) {
78 DLOG(INFO) << "Error: get offset out of bounds"; 78 DLOG(INFO) << "Error: get offset out of bounds";
79 return parse_error::kParseOutOfBounds; 79 return parse_error::kParseOutOfBounds;
80 } 80 }
81 81
82 parse_error::ParseError result = handler_->DoCommand( 82 parse_error::ParseError result = handler_->DoCommand(
83 header.command, header.size - 1, buffer_ + get); 83 header.command, header.size - 1, buffer_ + get);
84 // TODO(gman): If you want to log errors this is the best place to catch them. 84 // TODO(gman): If you want to log errors this is the best place to catch them.
85 // It seems like we need an official way to turn on a debug mode and 85 // It seems like we need an official way to turn on a debug mode and
86 // get these errors. 86 // get these errors.
87 if (result != parse_error::kParseNoError) { 87 if (result != parse_error::kParseNoError) {
(...skipping 13 matching lines...) Expand all
101 // is encountered. 101 // is encountered.
102 parse_error::ParseError CommandParser::ProcessAllCommands() { 102 parse_error::ParseError CommandParser::ProcessAllCommands() {
103 while (!IsEmpty()) { 103 while (!IsEmpty()) {
104 parse_error::ParseError error = ProcessCommand(); 104 parse_error::ParseError error = ProcessCommand();
105 if (error) return error; 105 if (error) return error;
106 } 106 }
107 return parse_error::kParseNoError; 107 return parse_error::kParseNoError;
108 } 108 }
109 109
110 } // namespace command_buffer 110 } // namespace command_buffer
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.cc ('k') | gpu/command_buffer/service/command_buffer_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698