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

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

Issue 1681393003: cc: Add MainAndImplFrameTimeDelta UMA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Non bool version; Fix abort bug; Created 4 years, 10 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(
674 drawing_with_new_active_tree, main_thread_missed_last_deadline,
675 begin_impl_frame_tracker_.DangerousMethodCurrentOrLast().frame_time);
672 } 676 }
673 677
674 void Scheduler::DrawAndSwapForced() { 678 void Scheduler::DrawAndSwapForced() {
675 bool drawing_with_new_active_tree = 679 bool drawing_with_new_active_tree =
676 state_machine_.active_tree_needs_first_draw(); 680 state_machine_.active_tree_needs_first_draw();
681 bool main_thread_missed_last_deadline =
682 state_machine_.main_thread_missed_last_deadline();
677 compositor_timing_history_->WillDraw(); 683 compositor_timing_history_->WillDraw();
678 state_machine_.WillDraw(); 684 state_machine_.WillDraw();
679 DrawResult result = client_->ScheduledActionDrawAndSwapForced(); 685 DrawResult result = client_->ScheduledActionDrawAndSwapForced();
680 state_machine_.DidDraw(result); 686 state_machine_.DidDraw(result);
681 compositor_timing_history_->DidDraw(drawing_with_new_active_tree); 687 compositor_timing_history_->DidDraw(
688 drawing_with_new_active_tree, main_thread_missed_last_deadline,
689 begin_impl_frame_tracker_.DangerousMethodCurrentOrLast().frame_time);
682 } 690 }
683 691
684 void Scheduler::SetDeferCommits(bool defer_commits) { 692 void Scheduler::SetDeferCommits(bool defer_commits) {
685 TRACE_EVENT1("cc", "Scheduler::SetDeferCommits", 693 TRACE_EVENT1("cc", "Scheduler::SetDeferCommits",
686 "defer_commits", 694 "defer_commits",
687 defer_commits); 695 defer_commits);
688 state_machine_.SetDeferCommits(defer_commits); 696 state_machine_.SetDeferCommits(defer_commits);
689 ProcessScheduledActions(); 697 ProcessScheduledActions();
690 } 698 }
691 699
(...skipping 12 matching lines...) Expand all
704 "SchedulerStateMachine", 712 "SchedulerStateMachine",
705 "state", 713 "state",
706 AsValue()); 714 AsValue());
707 base::AutoReset<SchedulerStateMachine::Action> 715 base::AutoReset<SchedulerStateMachine::Action>
708 mark_inside_action(&inside_action_, action); 716 mark_inside_action(&inside_action_, action);
709 switch (action) { 717 switch (action) {
710 case SchedulerStateMachine::ACTION_NONE: 718 case SchedulerStateMachine::ACTION_NONE:
711 break; 719 break;
712 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: 720 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME:
713 compositor_timing_history_->WillBeginMainFrame( 721 compositor_timing_history_->WillBeginMainFrame(
714 begin_main_frame_args_.on_critical_path); 722 begin_main_frame_args_.on_critical_path,
723 begin_main_frame_args_.frame_time);
715 state_machine_.WillSendBeginMainFrame(); 724 state_machine_.WillSendBeginMainFrame();
716 // TODO(brianderson): Pass begin_main_frame_args_ directly to client. 725 // TODO(brianderson): Pass begin_main_frame_args_ directly to client.
717 client_->ScheduledActionSendBeginMainFrame(begin_main_frame_args_); 726 client_->ScheduledActionSendBeginMainFrame(begin_main_frame_args_);
718 break; 727 break;
719 case SchedulerStateMachine::ACTION_COMMIT: { 728 case SchedulerStateMachine::ACTION_COMMIT: {
720 // TODO(robliao): Remove ScopedTracker below once crbug.com/461509 is 729 // TODO(robliao): Remove ScopedTracker below once crbug.com/461509 is
721 // fixed. 730 // fixed.
722 tracked_objects::ScopedTracker tracking_profile4( 731 tracked_objects::ScopedTracker tracking_profile4(
723 FROM_HERE_WITH_EXPLICIT_FUNCTION( 732 FROM_HERE_WITH_EXPLICIT_FUNCTION(
724 "461509 Scheduler::ProcessScheduledActions4")); 733 "461509 Scheduler::ProcessScheduledActions4"));
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 } 911 }
903 912
904 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 913 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
905 return (state_machine_.begin_main_frame_state() == 914 return (state_machine_.begin_main_frame_state() ==
906 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || 915 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT ||
907 state_machine_.begin_main_frame_state() == 916 state_machine_.begin_main_frame_state() ==
908 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); 917 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED);
909 } 918 }
910 919
911 } // namespace cc 920 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698