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 <utility> |
7 #include <vector> | 8 #include <vector> |
8 | 9 |
9 #include "base/callback.h" | 10 #include "base/callback.h" |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/memory/shared_memory.h" | 12 #include "base/memory/shared_memory.h" |
12 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
13 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
14 #include "content/common/child_process_messages.h" | 15 #include "content/common/child_process_messages.h" |
15 #include "content/common/gpu/client/gpu_channel_host.h" | 16 #include "content/common/gpu/client/gpu_channel_host.h" |
16 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h" | 17 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h" |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 | 377 |
377 if (!Send(new GpuCommandBufferMsg_RegisterTransferBuffer(route_id_, | 378 if (!Send(new GpuCommandBufferMsg_RegisterTransferBuffer(route_id_, |
378 new_id, | 379 new_id, |
379 handle, | 380 handle, |
380 size))) { | 381 size))) { |
381 return NULL; | 382 return NULL; |
382 } | 383 } |
383 | 384 |
384 *id = new_id; | 385 *id = new_id; |
385 scoped_refptr<gpu::Buffer> buffer( | 386 scoped_refptr<gpu::Buffer> buffer( |
386 gpu::MakeBufferFromSharedMemory(shared_memory.Pass(), size)); | 387 gpu::MakeBufferFromSharedMemory(std::move(shared_memory), size)); |
387 return buffer; | 388 return buffer; |
388 } | 389 } |
389 | 390 |
390 void CommandBufferProxyImpl::DestroyTransferBuffer(int32_t id) { | 391 void CommandBufferProxyImpl::DestroyTransferBuffer(int32_t id) { |
391 CheckLock(); | 392 CheckLock(); |
392 if (last_state_.error != gpu::error::kNoError) | 393 if (last_state_.error != gpu::error::kNoError) |
393 return; | 394 return; |
394 | 395 |
395 Send(new GpuCommandBufferMsg_DestroyTransferBuffer(route_id_, id)); | 396 Send(new GpuCommandBufferMsg_DestroyTransferBuffer(route_id_, id)); |
396 } | 397 } |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 } | 768 } |
768 } | 769 } |
769 | 770 |
770 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, | 771 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, |
771 base::TimeDelta interval) { | 772 base::TimeDelta interval) { |
772 if (!update_vsync_parameters_completion_callback_.is_null()) | 773 if (!update_vsync_parameters_completion_callback_.is_null()) |
773 update_vsync_parameters_completion_callback_.Run(timebase, interval); | 774 update_vsync_parameters_completion_callback_.Run(timebase, interval); |
774 } | 775 } |
775 | 776 |
776 } // namespace content | 777 } // namespace content |
OLD | NEW |