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