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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 311 } |
312 } | 312 } |
313 CleanupFlushedReleases(highest_verified_flush_id); | 313 CleanupFlushedReleases(highest_verified_flush_id); |
314 } | 314 } |
315 if (put_offset_changed) { | 315 if (put_offset_changed) { |
316 latency_info_.clear(); | 316 latency_info_.clear(); |
317 pending_sync_token_fences_.clear(); | 317 pending_sync_token_fences_.clear(); |
318 } | 318 } |
319 } | 319 } |
320 | 320 |
321 void CommandBufferProxyImpl::AddLatencyInfo( | |
322 const std::vector<ui::LatencyInfo>& latency_info) { | |
323 CheckLock(); | |
324 for (size_t i = 0; i < latency_info.size(); i++) | |
325 latency_info_.push_back(latency_info[i]); | |
326 } | |
327 | |
328 void CommandBufferProxyImpl::SetSwapBuffersCompletionCallback( | 321 void CommandBufferProxyImpl::SetSwapBuffersCompletionCallback( |
329 const SwapBuffersCompletionCallback& callback) { | 322 const SwapBuffersCompletionCallback& callback) { |
330 CheckLock(); | 323 CheckLock(); |
331 swap_buffers_completion_callback_ = callback; | 324 swap_buffers_completion_callback_ = callback; |
332 } | 325 } |
333 | 326 |
334 void CommandBufferProxyImpl::SetUpdateVSyncParametersCallback( | 327 void CommandBufferProxyImpl::SetUpdateVSyncParametersCallback( |
335 const UpdateVSyncParametersCallback& callback) { | 328 const UpdateVSyncParametersCallback& callback) { |
336 CheckLock(); | 329 CheckLock(); |
337 update_vsync_parameters_completion_callback_ = callback; | 330 update_vsync_parameters_completion_callback_ = callback; |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 int32_t release_stream_id = sync_token.extra_data_field(); | 673 int32_t release_stream_id = sync_token.extra_data_field(); |
681 if (release_stream_id == gpu::GPU_STREAM_INVALID) | 674 if (release_stream_id == gpu::GPU_STREAM_INVALID) |
682 return false; | 675 return false; |
683 | 676 |
684 if (release_stream_id != stream_id_) | 677 if (release_stream_id != stream_id_) |
685 channel_->FlushPendingStream(release_stream_id); | 678 channel_->FlushPendingStream(release_stream_id); |
686 | 679 |
687 return true; | 680 return true; |
688 } | 681 } |
689 | 682 |
| 683 void CommandBufferProxyImpl::AddLatencyInfo( |
| 684 const std::vector<ui::LatencyInfo>& latency_info) { |
| 685 CheckLock(); |
| 686 for (size_t i = 0; i < latency_info.size(); i++) |
| 687 latency_info_.push_back(latency_info[i]); |
| 688 } |
| 689 |
690 void CommandBufferProxyImpl::SignalQuery(uint32_t query, | 690 void CommandBufferProxyImpl::SignalQuery(uint32_t query, |
691 const base::Closure& callback) { | 691 const base::Closure& callback) { |
692 CheckLock(); | 692 CheckLock(); |
693 base::AutoLock lock(last_state_lock_); | 693 base::AutoLock lock(last_state_lock_); |
694 if (last_state_.error != gpu::error::kNoError) | 694 if (last_state_.error != gpu::error::kNoError) |
695 return; | 695 return; |
696 | 696 |
697 // Signal identifiers are hidden, so nobody outside of this class will see | 697 // Signal identifiers are hidden, so nobody outside of this class will see |
698 // them. (And thus, they cannot save them.) The IDs themselves only last | 698 // them. (And thus, they cannot save them.) The IDs themselves only last |
699 // until the callback is invoked, which will happen as soon as the GPU | 699 // until the callback is invoked, which will happen as soon as the GPU |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 return; | 947 return; |
948 channel_->FlushPendingStream(stream_id_); | 948 channel_->FlushPendingStream(stream_id_); |
949 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); | 949 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); |
950 channel_->RemoveRoute(route_id_); | 950 channel_->RemoveRoute(route_id_); |
951 channel_ = nullptr; | 951 channel_ = nullptr; |
952 if (gpu_control_client_) | 952 if (gpu_control_client_) |
953 gpu_control_client_->OnGpuControlLostContext(); | 953 gpu_control_client_->OnGpuControlLostContext(); |
954 } | 954 } |
955 | 955 |
956 } // namespace gpu | 956 } // namespace gpu |
OLD | NEW |