Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: cc/scheduler/scheduler.cc

Issue 2778223005: Plumb activation time to main (Closed)
Patch Set: add a vector instead of single activate frame time Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_time_.push_back(std::make_pair(
brianderson 2017/04/06 23:43:15 emplace_back?
panicker 2017/04/08 00:29:06 Done.
98 client_->SyncTreeSourceFrameNumber(), base::TimeTicks::Now()));
99 fprintf(stderr, "\n\t\tScheduler::NotifyReadyToActivate: ptree: %d",
vmpstr 2017/04/05 19:11:33 this is just for debugging I assume?
panicker 2017/04/08 00:29:06 Yes I plan to clean these up before submitting
100 client_->SyncTreeSourceFrameNumber());
101 }
95 ProcessScheduledActions(); 102 ProcessScheduledActions();
96 } 103 }
97 104
98 void Scheduler::NotifyReadyToDraw() { 105 void Scheduler::NotifyReadyToDraw() {
99 // Future work might still needed for crbug.com/352894. 106 // Future work might still needed for crbug.com/352894.
100 state_machine_.NotifyReadyToDraw(); 107 state_machine_.NotifyReadyToDraw();
101 ProcessScheduledActions(); 108 ProcessScheduledActions();
102 } 109 }
103 110
104 void Scheduler::SetBeginFrameSource(BeginFrameSource* source) { 111 void Scheduler::SetBeginFrameSource(BeginFrameSource* source) {
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 &inside_action_, action); 627 &inside_action_, action);
621 switch (action) { 628 switch (action) {
622 case SchedulerStateMachine::ACTION_NONE: 629 case SchedulerStateMachine::ACTION_NONE:
623 break; 630 break;
624 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: 631 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME:
625 compositor_timing_history_->WillBeginMainFrame( 632 compositor_timing_history_->WillBeginMainFrame(
626 begin_main_frame_args_.on_critical_path, 633 begin_main_frame_args_.on_critical_path,
627 begin_main_frame_args_.frame_time); 634 begin_main_frame_args_.frame_time);
628 state_machine_.WillSendBeginMainFrame(); 635 state_machine_.WillSendBeginMainFrame();
629 // TODO(brianderson): Pass begin_main_frame_args_ directly to client. 636 // TODO(brianderson): Pass begin_main_frame_args_ directly to client.
637 begin_main_frame_args_.ready_to_activate_time = ready_to_activate_time_;
vmpstr 2017/04/05 19:11:33 std::move
panicker 2017/04/08 00:29:06 Done.
638 ready_to_activate_time_.clear();
630 client_->ScheduledActionSendBeginMainFrame(begin_main_frame_args_); 639 client_->ScheduledActionSendBeginMainFrame(begin_main_frame_args_);
631 break; 640 break;
632 case SchedulerStateMachine::ACTION_COMMIT: { 641 case SchedulerStateMachine::ACTION_COMMIT: {
633 bool commit_has_no_updates = false; 642 bool commit_has_no_updates = false;
634 state_machine_.WillCommit(commit_has_no_updates); 643 state_machine_.WillCommit(commit_has_no_updates);
635 client_->ScheduledActionCommit(); 644 client_->ScheduledActionCommit();
636 break; 645 break;
637 } 646 }
638 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: 647 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE:
639 compositor_timing_history_->WillActivate(); 648 compositor_timing_history_->WillActivate();
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 } 808 }
800 809
801 BeginFrameAck Scheduler::CurrentBeginFrameAckForActiveTree() const { 810 BeginFrameAck Scheduler::CurrentBeginFrameAckForActiveTree() const {
802 return BeginFrameAck( 811 return BeginFrameAck(
803 begin_main_frame_args_.source_id, begin_main_frame_args_.sequence_number, 812 begin_main_frame_args_.source_id, begin_main_frame_args_.sequence_number,
804 state_machine_.last_begin_frame_sequence_number_active_tree_was_fresh(), 813 state_machine_.last_begin_frame_sequence_number_active_tree_was_fresh(),
805 true); 814 true);
806 } 815 }
807 816
808 } // namespace cc 817 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698