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

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

Issue 500243002: Remove implicit conversions from scoped_refptr to T* in gpu/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert silliness Created 6 years, 3 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
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 CommonDecoder::CommonDecoder() : engine_(NULL) {} 59 CommonDecoder::CommonDecoder() : engine_(NULL) {}
60 60
61 CommonDecoder::~CommonDecoder() {} 61 CommonDecoder::~CommonDecoder() {}
62 62
63 void* CommonDecoder::GetAddressAndCheckSize(unsigned int shm_id, 63 void* CommonDecoder::GetAddressAndCheckSize(unsigned int shm_id,
64 unsigned int data_offset, 64 unsigned int data_offset,
65 unsigned int data_size) { 65 unsigned int data_size) {
66 CHECK(engine_); 66 CHECK(engine_);
67 scoped_refptr<gpu::Buffer> buffer = engine_->GetSharedMemoryBuffer(shm_id); 67 scoped_refptr<gpu::Buffer> buffer = engine_->GetSharedMemoryBuffer(shm_id);
68 if (!buffer) 68 if (!buffer.get())
69 return NULL; 69 return NULL;
70 return buffer->GetDataAddress(data_offset, data_size); 70 return buffer->GetDataAddress(data_offset, data_size);
71 } 71 }
72 72
73 scoped_refptr<gpu::Buffer> CommonDecoder::GetSharedMemoryBuffer( 73 scoped_refptr<gpu::Buffer> CommonDecoder::GetSharedMemoryBuffer(
74 unsigned int shm_id) { 74 unsigned int shm_id) {
75 return engine_->GetSharedMemoryBuffer(shm_id); 75 return engine_->GetSharedMemoryBuffer(shm_id);
76 } 76 }
77 77
78 const char* CommonDecoder::GetCommonCommandName( 78 const char* CommonDecoder::GetCommonCommandName(
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 286 }
287 const void* src = bucket->GetData(offset, size); 287 const void* src = bucket->GetData(offset, size);
288 if (!src) { 288 if (!src) {
289 return error::kInvalidArguments; 289 return error::kInvalidArguments;
290 } 290 }
291 memcpy(data, src, size); 291 memcpy(data, src, size);
292 return error::kNoError; 292 return error::kNoError;
293 } 293 }
294 294
295 } // namespace gpu 295 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/command_buffer_service.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698