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

Unified Diff: cc/scheduler/scheduler.cc

Issue 1762823002: Remove runtime toggling of throttling frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler.cc
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc
index 0af7fa6fb3b4efcc05a3ddddfd66eda09dd524c8..a84c1ba8a67c4b2b01c8705b248821683be4100a 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -64,7 +64,6 @@ Scheduler::Scheduler(
unthrottled_frame_source_(std::move(unthrottled_frame_source)),
frame_source_(BeginFrameSourceMultiplexer::Create()),
observing_frame_source_(false),
- throttle_frame_production_(false),
compositor_timing_history_(std::move(compositor_timing_history)),
begin_impl_frame_deadline_mode_(
SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_NONE),
@@ -91,7 +90,12 @@ Scheduler::Scheduler(
frame_source_->AddSource(unthrottled_frame_source_.get());
unthrottled_frame_source_->SetClientReady();
- SetThrottleFrameProduction(settings_.throttle_frame_production);
+ if (settings_.throttle_frame_production) {
+ frame_source_->SetActiveSource(primary_frame_source());
+ } else {
+ frame_source_->SetActiveSource(unthrottled_frame_source_.get());
+ }
+ ProcessScheduledActions();
}
Scheduler::~Scheduler() {
@@ -152,16 +156,6 @@ void Scheduler::NotifyReadyToDraw() {
ProcessScheduledActions();
}
-void Scheduler::SetThrottleFrameProduction(bool throttle) {
- throttle_frame_production_ = throttle;
- if (throttle) {
- frame_source_->SetActiveSource(primary_frame_source());
- } else {
- frame_source_->SetActiveSource(unthrottled_frame_source_.get());
- }
- ProcessScheduledActions();
-}
-
void Scheduler::SetNeedsBeginMainFrame() {
state_machine_.SetNeedsBeginMainFrame();
ProcessScheduledActions();
@@ -808,7 +802,8 @@ void Scheduler::AsValueInto(base::trace_event::TracedValue* state) const {
state->BeginDictionary("scheduler_state");
state->SetBoolean("external_frame_source_", !!external_frame_source_);
- state->SetBoolean("throttle_frame_production_", throttle_frame_production_);
+ state->SetBoolean("throttle_frame_production_",
+ settings_.throttle_frame_production);
state->SetDouble("authoritative_vsync_interval_ms",
authoritative_vsync_interval_.InMillisecondsF());
state->SetDouble(
@@ -870,7 +865,7 @@ bool Scheduler::ShouldRecoverImplLatency(
// Disable impl thread latency recovery when using the unthrottled
// begin frame source since we will always get a BeginFrame before
// the swap ack and our heuristics below will not work.
- if (!throttle_frame_production_)
+ if (!settings_.throttle_frame_production)
return false;
// If we are swap throttled at the BeginFrame, that means the impl thread is
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698