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

Side by Side Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 213353005: Refactor gpu::Buffer to allow different types of backing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix pointer alignment in tests Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/common/gpu/gpu_command_buffer_stub.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 "content/common/gpu/client/command_buffer_proxy_impl.h" 5 #include "content/common/gpu/client/command_buffer_proxy_impl.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 return NULL; 279 return NULL;
280 280
281 if (!Send(new GpuCommandBufferMsg_RegisterTransferBuffer(route_id_, 281 if (!Send(new GpuCommandBufferMsg_RegisterTransferBuffer(route_id_,
282 new_id, 282 new_id,
283 handle, 283 handle,
284 size))) { 284 size))) {
285 return NULL; 285 return NULL;
286 } 286 }
287 287
288 *id = new_id; 288 *id = new_id;
289 scoped_refptr<gpu::Buffer> buffer = 289 scoped_refptr<gpu::Buffer> buffer(
290 new gpu::Buffer(shared_memory.Pass(), size); 290 gpu::MakeBufferFromSharedMemory(shared_memory.Pass(), size));
291 return buffer; 291 return buffer;
292 } 292 }
293 293
294 void CommandBufferProxyImpl::DestroyTransferBuffer(int32 id) { 294 void CommandBufferProxyImpl::DestroyTransferBuffer(int32 id) {
295 if (last_state_.error != gpu::error::kNoError) 295 if (last_state_.error != gpu::error::kNoError)
296 return; 296 return;
297 297
298 Send(new GpuCommandBufferMsg_DestroyTransferBuffer(route_id_, id)); 298 Send(new GpuCommandBufferMsg_DestroyTransferBuffer(route_id_, id));
299 } 299 }
300 300
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 const GpuConsoleMessageCallback& callback) { 518 const GpuConsoleMessageCallback& callback) {
519 console_message_callback_ = callback; 519 console_message_callback_ = callback;
520 } 520 }
521 521
522 void CommandBufferProxyImpl::TryUpdateState() { 522 void CommandBufferProxyImpl::TryUpdateState() {
523 if (last_state_.error == gpu::error::kNoError) 523 if (last_state_.error == gpu::error::kNoError)
524 shared_state()->Read(&last_state_); 524 shared_state()->Read(&last_state_);
525 } 525 }
526 526
527 } // namespace content 527 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698