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/profiler/scoped_tracker.h" | 8 #include "base/profiler/scoped_tracker.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "cc/debug/benchmark_instrumentation.h" | 10 #include "cc/debug/benchmark_instrumentation.h" |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
548 } | 548 } |
549 | 549 |
550 void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() { | 550 void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() { |
551 TRACE_EVENT0("cc,benchmark", | 551 TRACE_EVENT0("cc,benchmark", |
552 "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); | 552 "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); |
553 if (scheduler_on_impl_thread_) | 553 if (scheduler_on_impl_thread_) |
554 scheduler_on_impl_thread_->DidSwapBuffersComplete(); | 554 scheduler_on_impl_thread_->DidSwapBuffersComplete(); |
555 layer_tree_host_->DidCompleteSwapBuffers(); | 555 layer_tree_host_->DidCompleteSwapBuffers(); |
556 } | 556 } |
557 | 557 |
558 void SingleThreadProxy::OnDrawForOutputSurface() { | |
559 NOTREACHED() << "Implemented by ThreadProxy for synchronous compositor."; | |
560 } | |
561 | |
558 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { | 562 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { |
559 TRACE_EVENT0("cc,benchmark", "SingleThreadProxy::CompositeImmediately"); | 563 TRACE_EVENT0("cc,benchmark", "SingleThreadProxy::CompositeImmediately"); |
560 DCHECK(Proxy::IsMainThread()); | 564 DCHECK(Proxy::IsMainThread()); |
561 base::AutoReset<bool> inside_composite(&inside_synchronous_composite_, true); | 565 base::AutoReset<bool> inside_composite(&inside_synchronous_composite_, true); |
562 | 566 |
563 if (layer_tree_host_->output_surface_lost()) { | 567 if (layer_tree_host_->output_surface_lost()) { |
564 RequestNewOutputSurface(); | 568 RequestNewOutputSurface(); |
565 // RequestNewOutputSurface could have synchronously created an output | 569 // RequestNewOutputSurface could have synchronously created an output |
566 // surface, so check again before returning. | 570 // surface, so check again before returning. |
567 if (layer_tree_host_->output_surface_lost()) | 571 if (layer_tree_host_->output_surface_lost()) |
568 return; | 572 return; |
569 } | 573 } |
570 | 574 |
571 { | 575 { |
572 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create( | 576 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create( |
573 BEGINFRAME_FROM_HERE, frame_begin_time, base::TimeTicks(), | 577 BEGINFRAME_FROM_HERE, frame_begin_time, base::TimeTicks(), |
574 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::SYNCHRONOUS)); | 578 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL)); |
575 DoBeginMainFrame(begin_frame_args); | 579 DoBeginMainFrame(begin_frame_args); |
576 DoCommit(); | 580 DoCommit(); |
577 | 581 |
578 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises()) | 582 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises()) |
579 << "Commit should always succeed and transfer promises."; | 583 << "Commit should always succeed and transfer promises."; |
580 } | 584 } |
581 | 585 |
582 { | 586 { |
583 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); | 587 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); |
584 if (layer_tree_host_impl_->settings().impl_side_painting) { | 588 if (layer_tree_host_impl_->settings().impl_side_painting) { |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
893 } | 897 } |
894 } | 898 } |
895 | 899 |
896 void SingleThreadProxy::ScheduledActionPrepareTiles() { | 900 void SingleThreadProxy::ScheduledActionPrepareTiles() { |
897 TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionPrepareTiles"); | 901 TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionPrepareTiles"); |
898 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | 902 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); |
899 DebugScopedSetImplThread impl(this); | 903 DebugScopedSetImplThread impl(this); |
900 layer_tree_host_impl_->PrepareTiles(); | 904 layer_tree_host_impl_->PrepareTiles(); |
901 } | 905 } |
902 | 906 |
907 void SingleThreadProxy::ScheduledActionInvalidateOutputSurface() { | |
brianderson
2015/03/25 23:10:37
NOTREACHED?
sunnyps
2015/03/27 00:52:48
Done.
| |
908 DCHECK(layer_tree_host_impl_->output_surface()); | |
909 layer_tree_host_impl_->output_surface()->Invalidate(); | |
910 } | |
911 | |
903 void SingleThreadProxy::DidAnticipatedDrawTimeChange(base::TimeTicks time) { | 912 void SingleThreadProxy::DidAnticipatedDrawTimeChange(base::TimeTicks time) { |
904 } | 913 } |
905 | 914 |
906 base::TimeDelta SingleThreadProxy::DrawDurationEstimate() { | 915 base::TimeDelta SingleThreadProxy::DrawDurationEstimate() { |
907 return timing_history_.DrawDurationEstimate(); | 916 return timing_history_.DrawDurationEstimate(); |
908 } | 917 } |
909 | 918 |
910 base::TimeDelta SingleThreadProxy::BeginMainFrameToCommitDurationEstimate() { | 919 base::TimeDelta SingleThreadProxy::BeginMainFrameToCommitDurationEstimate() { |
911 return timing_history_.BeginMainFrameToCommitDurationEstimate(); | 920 return timing_history_.BeginMainFrameToCommitDurationEstimate(); |
912 } | 921 } |
913 | 922 |
914 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { | 923 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { |
915 return timing_history_.CommitToActivateDurationEstimate(); | 924 return timing_history_.CommitToActivateDurationEstimate(); |
916 } | 925 } |
917 | 926 |
918 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 927 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
919 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 928 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
920 } | 929 } |
921 | 930 |
922 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 931 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
923 layer_tree_host_->SendBeginFramesToChildren(args); | 932 layer_tree_host_->SendBeginFramesToChildren(args); |
924 } | 933 } |
925 | 934 |
926 } // namespace cc | 935 } // namespace cc |
OLD | NEW |