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/scheduler/scheduler.h" | 5 #include "cc/scheduler/scheduler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 compositor_timing_history_->WillFinishImplFrame( | 657 compositor_timing_history_->WillFinishImplFrame( |
658 state_machine_.needs_redraw()); | 658 state_machine_.needs_redraw()); |
659 state_machine_.OnBeginImplFrameDeadline(); | 659 state_machine_.OnBeginImplFrameDeadline(); |
660 ProcessScheduledActions(); | 660 ProcessScheduledActions(); |
661 FinishImplFrame(); | 661 FinishImplFrame(); |
662 } | 662 } |
663 | 663 |
664 void Scheduler::DrawAndSwapIfPossible() { | 664 void Scheduler::DrawAndSwapIfPossible() { |
665 bool drawing_with_new_active_tree = | 665 bool drawing_with_new_active_tree = |
666 state_machine_.active_tree_needs_first_draw(); | 666 state_machine_.active_tree_needs_first_draw(); |
| 667 bool main_thread_missed_last_deadline = |
| 668 state_machine_.main_thread_missed_last_deadline(); |
667 compositor_timing_history_->WillDraw(); | 669 compositor_timing_history_->WillDraw(); |
668 state_machine_.WillDraw(); | 670 state_machine_.WillDraw(); |
669 DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible(); | 671 DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible(); |
670 state_machine_.DidDraw(result); | 672 state_machine_.DidDraw(result); |
671 compositor_timing_history_->DidDraw(drawing_with_new_active_tree); | 673 compositor_timing_history_->DidDraw(drawing_with_new_active_tree, |
| 674 main_thread_missed_last_deadline); |
672 } | 675 } |
673 | 676 |
674 void Scheduler::DrawAndSwapForced() { | 677 void Scheduler::DrawAndSwapForced() { |
675 bool drawing_with_new_active_tree = | 678 bool drawing_with_new_active_tree = |
676 state_machine_.active_tree_needs_first_draw(); | 679 state_machine_.active_tree_needs_first_draw(); |
| 680 bool main_thread_missed_last_deadline = |
| 681 state_machine_.main_thread_missed_last_deadline(); |
677 compositor_timing_history_->WillDraw(); | 682 compositor_timing_history_->WillDraw(); |
678 state_machine_.WillDraw(); | 683 state_machine_.WillDraw(); |
679 DrawResult result = client_->ScheduledActionDrawAndSwapForced(); | 684 DrawResult result = client_->ScheduledActionDrawAndSwapForced(); |
680 state_machine_.DidDraw(result); | 685 state_machine_.DidDraw(result); |
681 compositor_timing_history_->DidDraw(drawing_with_new_active_tree); | 686 compositor_timing_history_->DidDraw(drawing_with_new_active_tree, |
| 687 main_thread_missed_last_deadline); |
682 } | 688 } |
683 | 689 |
684 void Scheduler::SetDeferCommits(bool defer_commits) { | 690 void Scheduler::SetDeferCommits(bool defer_commits) { |
685 TRACE_EVENT1("cc", "Scheduler::SetDeferCommits", | 691 TRACE_EVENT1("cc", "Scheduler::SetDeferCommits", |
686 "defer_commits", | 692 "defer_commits", |
687 defer_commits); | 693 defer_commits); |
688 state_machine_.SetDeferCommits(defer_commits); | 694 state_machine_.SetDeferCommits(defer_commits); |
689 ProcessScheduledActions(); | 695 ProcessScheduledActions(); |
690 } | 696 } |
691 | 697 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 } | 908 } |
903 | 909 |
904 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 910 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
905 return (state_machine_.begin_main_frame_state() == | 911 return (state_machine_.begin_main_frame_state() == |
906 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || | 912 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || |
907 state_machine_.begin_main_frame_state() == | 913 state_machine_.begin_main_frame_state() == |
908 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); | 914 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); |
909 } | 915 } |
910 | 916 |
911 } // namespace cc | 917 } // namespace cc |
OLD | NEW |