| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |