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

Unified Diff: cc/scheduler/scheduler.cc

Issue 2411793008: Adds BeginFrameControl via DevTools.
Patch Set: BFC prototype v2 with allow_latency_opts and waiting for BFOs. Created 4 years, 1 month 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/output/begin_frame_args.cc ('k') | cc/scheduler/scheduler_state_machine.h » ('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 14d5e69e6a0b6521be64398bb0755aca1ce5e559..622b88524d0bd0559e6406a41ced1e3e479f7708 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -396,6 +396,9 @@ void Scheduler::BeginImplFrameWithDeadline(const BeginFrameArgs& args) {
return;
}
+ state_machine_.SetBeginFrameAllowsLatencyOptimizations(
+ adjusted_args.allow_latency_optimizations);
+
BeginImplFrame(adjusted_args);
}
@@ -696,6 +699,10 @@ bool Scheduler::ShouldRecoverMainLatency(
if (state_machine_.ImplLatencyTakesPriority())
return false;
+ // If the args explicitly forbid it, we shouldn't skip BeginMainFrames.
+ if (!args.allow_latency_optimizations)
+ return false;
+
return can_activate_before_deadline;
}
@@ -719,6 +726,10 @@ bool Scheduler::ShouldRecoverImplLatency(
if (!impl_thread_is_likely_high_latency)
return false;
+ // If the args explicitly forbid it, we shouldn't skip BeginFrames.
+ if (!args.allow_latency_optimizations)
+ return false;
+
// The deadline may be in the past if our draw time is too long.
bool can_draw_before_deadline = args.frame_time < args.deadline;
« no previous file with comments | « cc/output/begin_frame_args.cc ('k') | cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698