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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 } | 85 } |
86 | 86 |
87 void Scheduler::SetCanDraw(bool can_draw) { | 87 void Scheduler::SetCanDraw(bool can_draw) { |
88 state_machine_.SetCanDraw(can_draw); | 88 state_machine_.SetCanDraw(can_draw); |
89 ProcessScheduledActions(); | 89 ProcessScheduledActions(); |
90 } | 90 } |
91 | 91 |
92 void Scheduler::NotifyReadyToActivate() { | 92 void Scheduler::NotifyReadyToActivate() { |
93 compositor_timing_history_->ReadyToActivate(); | 93 compositor_timing_history_->ReadyToActivate(); |
94 state_machine_.NotifyReadyToActivate(); | 94 state_machine_.NotifyReadyToActivate(); |
95 // Note the activate source-frame and timestamp | |
96 if (client_->SyncTreeSourceFrameNumber() != 0) { | |
97 ready_to_activate_source_frame_number_ = | |
98 client_->SyncTreeSourceFrameNumber(); | |
brianderson
2017/03/30 18:32:03
If you store this information in the ProxyImpl, yo
panicker
2017/03/30 21:31:25
The reason I did this here as opposed to ProxyImpl
| |
99 // ready_to_activate_time_ = base::TimeTicks::Now(); | |
100 fprintf(stderr, "\n\t\tScheduler::NotifyReadyToActivate: ptree: %d", | |
101 ready_to_activate_source_frame_number_); | |
102 } | |
95 ProcessScheduledActions(); | 103 ProcessScheduledActions(); |
96 } | 104 } |
97 | 105 |
98 void Scheduler::NotifyReadyToDraw() { | 106 void Scheduler::NotifyReadyToDraw() { |
99 // Future work might still needed for crbug.com/352894. | 107 // Future work might still needed for crbug.com/352894. |
100 state_machine_.NotifyReadyToDraw(); | 108 state_machine_.NotifyReadyToDraw(); |
101 ProcessScheduledActions(); | 109 ProcessScheduledActions(); |
102 } | 110 } |
103 | 111 |
104 void Scheduler::SetBeginFrameSource(BeginFrameSource* source) { | 112 void Scheduler::SetBeginFrameSource(BeginFrameSource* source) { |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
620 &inside_action_, action); | 628 &inside_action_, action); |
621 switch (action) { | 629 switch (action) { |
622 case SchedulerStateMachine::ACTION_NONE: | 630 case SchedulerStateMachine::ACTION_NONE: |
623 break; | 631 break; |
624 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: | 632 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: |
625 compositor_timing_history_->WillBeginMainFrame( | 633 compositor_timing_history_->WillBeginMainFrame( |
626 begin_main_frame_args_.on_critical_path, | 634 begin_main_frame_args_.on_critical_path, |
627 begin_main_frame_args_.frame_time); | 635 begin_main_frame_args_.frame_time); |
628 state_machine_.WillSendBeginMainFrame(); | 636 state_machine_.WillSendBeginMainFrame(); |
629 // TODO(brianderson): Pass begin_main_frame_args_ directly to client. | 637 // TODO(brianderson): Pass begin_main_frame_args_ directly to client. |
638 // Add the args for activate. | |
639 begin_main_frame_args_.ready_to_activate_time = ready_to_activate_time_; | |
640 begin_main_frame_args_.ready_to_activate_source_frame_number = | |
641 ready_to_activate_source_frame_number_; | |
630 client_->ScheduledActionSendBeginMainFrame(begin_main_frame_args_); | 642 client_->ScheduledActionSendBeginMainFrame(begin_main_frame_args_); |
631 break; | 643 break; |
632 case SchedulerStateMachine::ACTION_COMMIT: { | 644 case SchedulerStateMachine::ACTION_COMMIT: { |
633 bool commit_has_no_updates = false; | 645 bool commit_has_no_updates = false; |
634 state_machine_.WillCommit(commit_has_no_updates); | 646 state_machine_.WillCommit(commit_has_no_updates); |
635 client_->ScheduledActionCommit(); | 647 client_->ScheduledActionCommit(); |
636 break; | 648 break; |
637 } | 649 } |
638 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: | 650 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: |
639 compositor_timing_history_->WillActivate(); | 651 compositor_timing_history_->WillActivate(); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
799 } | 811 } |
800 | 812 |
801 BeginFrameAck Scheduler::CurrentBeginFrameAckForActiveTree() const { | 813 BeginFrameAck Scheduler::CurrentBeginFrameAckForActiveTree() const { |
802 return BeginFrameAck( | 814 return BeginFrameAck( |
803 begin_main_frame_args_.source_id, begin_main_frame_args_.sequence_number, | 815 begin_main_frame_args_.source_id, begin_main_frame_args_.sequence_number, |
804 state_machine_.last_begin_frame_sequence_number_active_tree_was_fresh(), | 816 state_machine_.last_begin_frame_sequence_number_active_tree_was_fresh(), |
805 0, true); | 817 0, true); |
806 } | 818 } |
807 | 819 |
808 } // namespace cc | 820 } // namespace cc |
OLD | NEW |