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

Unified Diff: cc/scheduler/scheduler_state_machine.h

Issue 54913003: Scheduler: Switch from high to low latency mode if possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add checks for MainThreadIsInHighLatencyMode. Created 7 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/scheduler/scheduler_settings.cc ('k') | cc/scheduler/scheduler_state_machine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler_state_machine.h
diff --git a/cc/scheduler/scheduler_state_machine.h b/cc/scheduler/scheduler_state_machine.h
index 9b6d4fb41ed622c5f2fe766c813e7479ed0b0ec7..a29e388beb8a1a24391a7512b3cffa3f2deba3f9 100644
--- a/cc/scheduler/scheduler_state_machine.h
+++ b/cc/scheduler/scheduler_state_machine.h
@@ -146,6 +146,10 @@ class CC_EXPORT SchedulerStateMachine {
return begin_impl_frame_state_;
}
+ // If the main thread didn't manage to produce a new frame in time for the
+ // impl thread to draw, it is in a high latency mode.
+ bool MainThreadIsInHighLatencyMode() const;
+
// PollForAnticipatedDrawTriggers is used by the synchronous compositor to
// avoid requesting BeginImplFrames when we won't actually draw but still
// need to advance our state at vsync intervals.
@@ -209,6 +213,8 @@ class CC_EXPORT SchedulerStateMachine {
// Set that we can create the first OutputSurface and start the scheduler.
void SetCanStart() { can_start_ = true; }
+ void SetSkipBeginMainFrameToReduceLatency(bool skip);
+
// Indicates whether drawing would, at this time, make sense.
// CanDraw can be used to supress flashes or checkerboarding
// when such behavior would be undesirable.
@@ -288,6 +294,7 @@ class CC_EXPORT SchedulerStateMachine {
bool draw_if_possible_failed_;
bool did_create_and_initialize_first_output_surface_;
bool smoothness_takes_priority_;
+ bool skip_begin_main_frame_to_reduce_latency_;
private:
DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine);
« no previous file with comments | « cc/scheduler/scheduler_settings.cc ('k') | cc/scheduler/scheduler_state_machine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698