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 "gpu/ipc/client/command_buffer_proxy_impl.h" | 5 #include "gpu/ipc/client/command_buffer_proxy_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 CheckLock(); | 328 CheckLock(); |
329 swap_buffers_completion_callback_ = callback; | 329 swap_buffers_completion_callback_ = callback; |
330 } | 330 } |
331 | 331 |
332 void CommandBufferProxyImpl::SetUpdateVSyncParametersCallback( | 332 void CommandBufferProxyImpl::SetUpdateVSyncParametersCallback( |
333 const UpdateVSyncParametersCallback& callback) { | 333 const UpdateVSyncParametersCallback& callback) { |
334 CheckLock(); | 334 CheckLock(); |
335 update_vsync_parameters_completion_callback_ = callback; | 335 update_vsync_parameters_completion_callback_ = callback; |
336 } | 336 } |
337 | 337 |
| 338 void CommandBufferProxyImpl::SetNeedsVSync(bool needs_vsync) { |
| 339 CheckLock(); |
| 340 base::AutoLock lock(last_state_lock_); |
| 341 if (last_state_.error != gpu::error::kNoError) |
| 342 return; |
| 343 |
| 344 Send(new GpuCommandBufferMsg_SetNeedsVSync(route_id_, needs_vsync)); |
| 345 } |
| 346 |
338 gpu::CommandBuffer::State CommandBufferProxyImpl::WaitForTokenInRange( | 347 gpu::CommandBuffer::State CommandBufferProxyImpl::WaitForTokenInRange( |
339 int32_t start, | 348 int32_t start, |
340 int32_t end) { | 349 int32_t end) { |
341 CheckLock(); | 350 CheckLock(); |
342 base::AutoLock lock(last_state_lock_); | 351 base::AutoLock lock(last_state_lock_); |
343 TRACE_EVENT2("gpu", "CommandBufferProxyImpl::WaitForToken", "start", start, | 352 TRACE_EVENT2("gpu", "CommandBufferProxyImpl::WaitForToken", "start", start, |
344 "end", end); | 353 "end", end); |
345 // Error needs to be checked in case the state was updated on another thread. | 354 // Error needs to be checked in case the state was updated on another thread. |
346 // We need to make sure that the reentrant context loss callback is called so | 355 // We need to make sure that the reentrant context loss callback is called so |
347 // that the share group is also lost before we return any error up the stack. | 356 // that the share group is also lost before we return any error up the stack. |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 return; | 936 return; |
928 channel_->FlushPendingStream(stream_id_); | 937 channel_->FlushPendingStream(stream_id_); |
929 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); | 938 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); |
930 channel_->RemoveRoute(route_id_); | 939 channel_->RemoveRoute(route_id_); |
931 channel_ = nullptr; | 940 channel_ = nullptr; |
932 if (gpu_control_client_) | 941 if (gpu_control_client_) |
933 gpu_control_client_->OnGpuControlLostContext(); | 942 gpu_control_client_->OnGpuControlLostContext(); |
934 } | 943 } |
935 | 944 |
936 } // namespace gpu | 945 } // namespace gpu |
OLD | NEW |