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

Side by Side Diff: gpu/ipc/client/command_buffer_proxy_impl.cc

Issue 2555173003: [Do not submit] D3DKMTWaitForVerticalBlankEvent VSync prototype (Closed)
Patch Set: Added command line switch and experiment support Created 3 years, 11 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
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 "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
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::EnableVSync(bool enabled) {
339 CheckLock();
340 base::AutoLock lock(last_state_lock_);
341 if (last_state_.error != gpu::error::kNoError)
342 return;
343
344 Send(new GpuCommandBufferMsg_EnableVSync(route_id_, enabled));
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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 return; 955 return;
947 channel_->FlushPendingStream(stream_id_); 956 channel_->FlushPendingStream(stream_id_);
948 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); 957 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_));
949 channel_->RemoveRoute(route_id_); 958 channel_->RemoveRoute(route_id_);
950 channel_ = nullptr; 959 channel_ = nullptr;
951 if (gpu_control_client_) 960 if (gpu_control_client_)
952 gpu_control_client_->OnGpuControlLostContext(); 961 gpu_control_client_->OnGpuControlLostContext();
953 } 962 }
954 963
955 } // namespace gpu 964 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698