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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

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: Created 7 years, 2 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
Index: cc/scheduler/scheduler_state_machine.cc
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index 0fd0f57b3b25b8466f8479c933ac10c89db314a7..9b1a93056301579c828cd4a7c073ea8e863b1a45 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -41,7 +41,8 @@ SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings& settings)
active_tree_needs_first_draw_(false),
draw_if_possible_failed_(false),
did_create_and_initialize_first_output_surface_(false),
- smoothness_takes_priority_(false) {}
+ smoothness_takes_priority_(false),
+ skip_begin_main_frame_(false) {}
const char* SchedulerStateMachine::OutputSurfaceStateToString(
OutputSurfaceState state) {
@@ -259,6 +260,8 @@ scoped_ptr<base::Value> SchedulerStateMachine::AsValue() const {
did_create_and_initialize_first_output_surface_);
minor_state->SetBoolean("smoothness_takes_priority",
smoothness_takes_priority_);
+ minor_state->SetBoolean("skip_begin_main_frame",
+ skip_begin_main_frame_);
state->Set("minor_state", minor_state.release());
return state.PassAs<base::Value>();
@@ -485,6 +488,9 @@ bool SchedulerStateMachine::ShouldSendBeginMainFrame() const {
if (!HasInitializedOutputSurface())
return false;
+ if (skip_begin_main_frame_)
+ return false;
+
return true;
}
@@ -756,6 +762,10 @@ void SchedulerStateMachine::SetMainThreadNeedsLayerTextures() {
main_thread_needs_layer_textures_ = true;
}
+void SchedulerStateMachine::SetSkipBeginMainFrame(bool skip) {
+ skip_begin_main_frame_ = skip;
+}
+
bool SchedulerStateMachine::BeginImplFrameNeeded() const {
// Proactive BeginImplFrames are bad for the synchronous compositor because we
// have to draw when we get the BeginImplFrame and could end up drawing many
@@ -919,6 +929,19 @@ bool SchedulerStateMachine::ShouldTriggerBeginImplFrameDeadlineEarly() const {
return false;
}
+bool SchedulerStateMachine::InHighLatencyMode() const {
+ if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING)
+ return false;
+
+ if (commit_state_ != COMMIT_STATE_IDLE)
+ return true;
+
+ if (active_tree_needs_first_draw_ || has_pending_tree_ )
brianderson 2013/11/01 00:22:59 Can you split this condition into separate if stat
+ return true;
+
+ return false;
+}
+
void SchedulerStateMachine::DidEnterPollForAnticipatedDrawTriggers() {
current_frame_number_++;
inside_poll_for_anticipated_draw_triggers_ = true;
« cc/scheduler/scheduler_state_machine.h ('K') | « cc/scheduler/scheduler_state_machine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698