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

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

Issue 2323123002: Make disable vsync run the renderer independently (Closed)
Patch Set: Created 4 years, 3 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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 Scheduler::AsValue() const { 709 Scheduler::AsValue() const {
710 std::unique_ptr<base::trace_event::TracedValue> state( 710 std::unique_ptr<base::trace_event::TracedValue> state(
711 new base::trace_event::TracedValue()); 711 new base::trace_event::TracedValue());
712 base::TimeTicks now = Now(); 712 base::TimeTicks now = Now();
713 713
714 state->BeginDictionary("state_machine"); 714 state->BeginDictionary("state_machine");
715 state_machine_.AsValueInto(state.get()); 715 state_machine_.AsValueInto(state.get());
716 state->EndDictionary(); 716 state->EndDictionary();
717 717
718 state->BeginDictionary("scheduler_state"); 718 state->BeginDictionary("scheduler_state");
719 state->SetBoolean("throttle_frame_production_",
720 settings_.throttle_frame_production);
721 state->SetDouble("estimated_parent_draw_time_ms", 719 state->SetDouble("estimated_parent_draw_time_ms",
722 estimated_parent_draw_time_.InMillisecondsF()); 720 estimated_parent_draw_time_.InMillisecondsF());
723 state->SetBoolean("observing_begin_frame_source", 721 state->SetBoolean("observing_begin_frame_source",
724 observing_begin_frame_source_); 722 observing_begin_frame_source_);
725 state->SetInteger("begin_retro_frame_args", 723 state->SetInteger("begin_retro_frame_args",
726 static_cast<int>(begin_retro_frame_args_.size())); 724 static_cast<int>(begin_retro_frame_args_.size()));
727 state->SetBoolean("begin_retro_frame_task", 725 state->SetBoolean("begin_retro_frame_task",
728 !begin_retro_frame_task_.IsCancelled()); 726 !begin_retro_frame_task_.IsCancelled());
729 state->SetBoolean("begin_impl_frame_deadline_task", 727 state->SetBoolean("begin_impl_frame_deadline_task",
730 !begin_impl_frame_deadline_task_.IsCancelled()); 728 !begin_impl_frame_deadline_task_.IsCancelled());
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 } 768 }
771 769
772 bool Scheduler::ShouldRecoverImplLatency( 770 bool Scheduler::ShouldRecoverImplLatency(
773 const BeginFrameArgs& args, 771 const BeginFrameArgs& args,
774 bool can_activate_before_deadline) const { 772 bool can_activate_before_deadline) const {
775 DCHECK(!settings_.using_synchronous_renderer_compositor); 773 DCHECK(!settings_.using_synchronous_renderer_compositor);
776 774
777 // Disable impl thread latency recovery when using the unthrottled 775 // Disable impl thread latency recovery when using the unthrottled
778 // begin frame source since we will always get a BeginFrame before 776 // begin frame source since we will always get a BeginFrame before
779 // the swap ack and our heuristics below will not work. 777 // the swap ack and our heuristics below will not work.
780 if (!settings_.throttle_frame_production) 778 if (begin_frame_source_ && !begin_frame_source_->IsThrottled())
781 return false; 779 return false;
782 780
783 // If we are swap throttled at the BeginFrame, that means the impl thread is 781 // If we are swap throttled at the BeginFrame, that means the impl thread is
784 // very likely in a high latency mode. 782 // very likely in a high latency mode.
785 bool impl_thread_is_likely_high_latency = state_machine_.SwapThrottled(); 783 bool impl_thread_is_likely_high_latency = state_machine_.SwapThrottled();
786 if (!impl_thread_is_likely_high_latency) 784 if (!impl_thread_is_likely_high_latency)
787 return false; 785 return false;
788 786
789 // The deadline may be in the past if our draw time is too long. 787 // The deadline may be in the past if our draw time is too long.
790 bool can_draw_before_deadline = args.frame_time < args.deadline; 788 bool can_draw_before_deadline = args.frame_time < args.deadline;
(...skipping 27 matching lines...) Expand all
818 } 816 }
819 817
820 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 818 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
821 return (state_machine_.begin_main_frame_state() == 819 return (state_machine_.begin_main_frame_state() ==
822 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || 820 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT ||
823 state_machine_.begin_main_frame_state() == 821 state_machine_.begin_main_frame_state() ==
824 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); 822 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED);
825 } 823 }
826 824
827 } // namespace cc 825 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698