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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 if (last_state_.error == gpu::error::kNoError) | 591 if (last_state_.error == gpu::error::kNoError) |
592 shared_state()->Read(&last_state_); | 592 shared_state()->Read(&last_state_); |
593 } | 593 } |
594 | 594 |
595 gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const { | 595 gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const { |
596 return reinterpret_cast<gpu::CommandBufferSharedState*>( | 596 return reinterpret_cast<gpu::CommandBufferSharedState*>( |
597 shared_state_shm_->memory()); | 597 shared_state_shm_->memory()); |
598 } | 598 } |
599 | 599 |
600 void CommandBufferProxyImpl::OnSwapBuffersCompleted( | 600 void CommandBufferProxyImpl::OnSwapBuffersCompleted( |
601 const std::vector<ui::LatencyInfo>& latency_info, | 601 const std::vector<ui::LatencyInfo>& latency_info) { |
602 gfx::SwapResult result) { | |
603 if (!swap_buffers_completion_callback_.is_null()) { | 602 if (!swap_buffers_completion_callback_.is_null()) { |
604 if (!ui::LatencyInfo::Verify( | 603 if (!ui::LatencyInfo::Verify( |
605 latency_info, "CommandBufferProxyImpl::OnSwapBuffersCompleted")) { | 604 latency_info, "CommandBufferProxyImpl::OnSwapBuffersCompleted")) { |
606 swap_buffers_completion_callback_.Run(std::vector<ui::LatencyInfo>(), | 605 swap_buffers_completion_callback_.Run(std::vector<ui::LatencyInfo>()); |
607 result); | |
608 return; | 606 return; |
609 } | 607 } |
610 swap_buffers_completion_callback_.Run(latency_info, result); | 608 swap_buffers_completion_callback_.Run(latency_info); |
611 } | 609 } |
612 } | 610 } |
613 | 611 |
614 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, | 612 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, |
615 base::TimeDelta interval) { | 613 base::TimeDelta interval) { |
616 if (!update_vsync_parameters_completion_callback_.is_null()) | 614 if (!update_vsync_parameters_completion_callback_.is_null()) |
617 update_vsync_parameters_completion_callback_.Run(timebase, interval); | 615 update_vsync_parameters_completion_callback_.Run(timebase, interval); |
618 } | 616 } |
619 | 617 |
620 } // namespace content | 618 } // namespace content |
OLD | NEW |