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

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

Issue 11613021: Removing the JumpRelative, Call, CallRelative and Return commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
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 #include "gpu/command_buffer/service/cmd_buffer_engine.h" 6 #include "gpu/command_buffer/service/cmd_buffer_engine.h"
7 7
8 namespace gpu { 8 namespace gpu {
9 9
10 CommonDecoder::Bucket::Bucket() : size_(0) {} 10 CommonDecoder::Bucket::Bucket() : size_(0) {}
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 error::Error CommonDecoder::HandleJump( 189 error::Error CommonDecoder::HandleJump(
190 uint32 immediate_data_size, 190 uint32 immediate_data_size,
191 const cmd::Jump& args) { 191 const cmd::Jump& args) {
192 if (!engine_->SetGetOffset(args.offset)) { 192 if (!engine_->SetGetOffset(args.offset)) {
193 return error::kInvalidArguments; 193 return error::kInvalidArguments;
194 } 194 }
195 return error::kNoError; 195 return error::kNoError;
196 } 196 }
197 197
198 error::Error CommonDecoder::HandleJumpRelative(
199 uint32 immediate_data_size,
200 const cmd::JumpRelative& args) {
201 if (!engine_->SetGetOffset(engine_->GetGetOffset() + args.offset)) {
202 return error::kInvalidArguments;
203 }
204 return error::kNoError;
205 }
206
207 error::Error CommonDecoder::HandleCall(
208 uint32 immediate_data_size,
209 const cmd::Call& args) {
210 if (!PushAddress(args.offset)) {
211 return error::kInvalidArguments;
212 }
213 return error::kNoError;
214 }
215
216 error::Error CommonDecoder::HandleCallRelative(
217 uint32 immediate_data_size,
218 const cmd::CallRelative& args) {
219 if (!PushAddress(engine_->GetGetOffset() + args.offset)) {
220 return error::kInvalidArguments;
221 }
222 return error::kNoError;
223 }
224
225 error::Error CommonDecoder::HandleReturn(
226 uint32 immediate_data_size,
227 const cmd::Return& args) {
228 if (call_stack_.empty()) {
229 return error::kInvalidArguments;
230 }
231 CommandAddress return_address = call_stack_.top();
232 call_stack_.pop();
233 if (!engine_->SetGetOffset(return_address.offset)) {
234 return error::kInvalidArguments;
235 }
236 return error::kNoError;
237 }
238
239 error::Error CommonDecoder::HandleSetBucketSize( 198 error::Error CommonDecoder::HandleSetBucketSize(
240 uint32 immediate_data_size, 199 uint32 immediate_data_size,
241 const cmd::SetBucketSize& args) { 200 const cmd::SetBucketSize& args) {
242 uint32 bucket_id = args.bucket_id; 201 uint32 bucket_id = args.bucket_id;
243 uint32 size = args.size; 202 uint32 size = args.size;
244 203
245 Bucket* bucket = CreateBucket(bucket_id); 204 Bucket* bucket = CreateBucket(bucket_id);
246 bucket->SetSize(size); 205 bucket->SetSize(size);
247 return error::kNoError; 206 return error::kNoError;
248 } 207 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 } 302 }
344 const void* src = bucket->GetData(offset, size); 303 const void* src = bucket->GetData(offset, size);
345 if (!src) { 304 if (!src) {
346 return error::kInvalidArguments; 305 return error::kInvalidArguments;
347 } 306 }
348 memcpy(data, src, size); 307 memcpy(data, src, size);
349 return error::kNoError; 308 return error::kNoError;
350 } 309 }
351 310
352 } // namespace gpu 311 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698