OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/trees/single_thread_proxy.h" | 5 #include "cc/trees/single_thread_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "cc/debug/benchmark_instrumentation.h" | 9 #include "cc/debug/benchmark_instrumentation.h" |
10 #include "cc/debug/devtools_instrumentation.h" | 10 #include "cc/debug/devtools_instrumentation.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 RequestNewOutputSurface(); | 506 RequestNewOutputSurface(); |
507 // RequestNewOutputSurface could have synchronously created an output | 507 // RequestNewOutputSurface could have synchronously created an output |
508 // surface, so check again before returning. | 508 // surface, so check again before returning. |
509 if (layer_tree_host_->output_surface_lost()) | 509 if (layer_tree_host_->output_surface_lost()) |
510 return; | 510 return; |
511 } | 511 } |
512 | 512 |
513 { | 513 { |
514 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create( | 514 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create( |
515 BEGINFRAME_FROM_HERE, frame_begin_time, base::TimeTicks(), | 515 BEGINFRAME_FROM_HERE, frame_begin_time, base::TimeTicks(), |
516 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::SYNCHRONOUS)); | 516 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL)); |
517 DoBeginMainFrame(begin_frame_args); | 517 DoBeginMainFrame(begin_frame_args); |
518 DoCommit(); | 518 DoCommit(); |
519 | 519 |
520 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises()) | 520 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises()) |
521 << "Commit should always succeed and transfer promises."; | 521 << "Commit should always succeed and transfer promises."; |
522 } | 522 } |
523 | 523 |
524 { | 524 { |
525 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); | 525 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); |
526 if (layer_tree_host_impl_->settings().impl_side_painting) { | 526 if (layer_tree_host_impl_->settings().impl_side_painting) { |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 } | 795 } |
796 } | 796 } |
797 | 797 |
798 void SingleThreadProxy::ScheduledActionPrepareTiles() { | 798 void SingleThreadProxy::ScheduledActionPrepareTiles() { |
799 TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionPrepareTiles"); | 799 TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionPrepareTiles"); |
800 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | 800 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); |
801 DebugScopedSetImplThread impl(this); | 801 DebugScopedSetImplThread impl(this); |
802 layer_tree_host_impl_->PrepareTiles(); | 802 layer_tree_host_impl_->PrepareTiles(); |
803 } | 803 } |
804 | 804 |
| 805 void SingleThreadProxy::ScheduledActionInvalidateOutputSurface() { |
| 806 DCHECK(layer_tree_host_impl_->output_surface()); |
| 807 layer_tree_host_impl_->output_surface()->Invalidate(); |
| 808 } |
| 809 |
805 void SingleThreadProxy::DidAnticipatedDrawTimeChange(base::TimeTicks time) { | 810 void SingleThreadProxy::DidAnticipatedDrawTimeChange(base::TimeTicks time) { |
806 } | 811 } |
807 | 812 |
808 base::TimeDelta SingleThreadProxy::DrawDurationEstimate() { | 813 base::TimeDelta SingleThreadProxy::DrawDurationEstimate() { |
809 return timing_history_.DrawDurationEstimate(); | 814 return timing_history_.DrawDurationEstimate(); |
810 } | 815 } |
811 | 816 |
812 base::TimeDelta SingleThreadProxy::BeginMainFrameToCommitDurationEstimate() { | 817 base::TimeDelta SingleThreadProxy::BeginMainFrameToCommitDurationEstimate() { |
813 return timing_history_.BeginMainFrameToCommitDurationEstimate(); | 818 return timing_history_.BeginMainFrameToCommitDurationEstimate(); |
814 } | 819 } |
815 | 820 |
816 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { | 821 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { |
817 return timing_history_.CommitToActivateDurationEstimate(); | 822 return timing_history_.CommitToActivateDurationEstimate(); |
818 } | 823 } |
819 | 824 |
820 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 825 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
821 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 826 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
822 } | 827 } |
823 | 828 |
824 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 829 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
825 layer_tree_host_->SendBeginFramesToChildren(args); | 830 layer_tree_host_->SendBeginFramesToChildren(args); |
826 } | 831 } |
827 | 832 |
828 } // namespace cc | 833 } // namespace cc |
OLD | NEW |