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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

Issue 337693005: cc: Control defer_commits logic by Scheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 5 years, 11 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_state_machine.h ('k') | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler_state_machine.cc
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index 71813baa18821fa6ae21246208dbc24f40d2fee2..7bce7eec5930513c1312f10b8fa18e64c572304a 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -48,7 +48,8 @@ SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings& settings)
skip_begin_main_frame_to_reduce_latency_(false),
continuous_painting_(false),
impl_latency_takes_priority_on_battery_(false),
- children_need_begin_frames_(false) {
+ children_need_begin_frames_(false),
+ defer_commits_(false) {
}
const char* SchedulerStateMachine::OutputSurfaceStateToString(
@@ -238,6 +239,7 @@ void SchedulerStateMachine::AsValueInto(base::debug::TracedValue* state,
state->SetBoolean("impl_latency_takes_priority_on_battery",
impl_latency_takes_priority_on_battery_);
state->SetBoolean("children_need_begin_frames", children_need_begin_frames_);
+ state->SetBoolean("defer_commits", defer_commits_);
state->EndDictionary();
}
@@ -414,6 +416,10 @@ bool SchedulerStateMachine::CouldSendBeginMainFrame() const {
if (!visible_)
return false;
+ // Do not make a new commits when it is deferred.
+ if (defer_commits_)
+ return false;
+
return true;
}
@@ -769,6 +775,10 @@ void SchedulerStateMachine::SetChildrenNeedBeginFrames(
children_need_begin_frames_ = children_need_begin_frames;
}
+void SchedulerStateMachine::SetDeferCommits(bool defer_commits) {
+ defer_commits_ = defer_commits;
+}
+
// These are the cases where we definitely (or almost definitely) have a
// new frame to animate and/or draw and can draw.
bool SchedulerStateMachine::BeginFrameNeededToAnimateOrDraw() const {
@@ -1052,6 +1062,7 @@ void SchedulerStateMachine::BeginMainFrameAborted(CommitEarlyOutReason reason) {
switch (reason) {
case CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST:
case CommitEarlyOutReason::ABORTED_NOT_VISIBLE:
+ case CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT:
commit_state_ = COMMIT_STATE_IDLE;
SetNeedsCommit();
return;
« no previous file with comments | « cc/scheduler/scheduler_state_machine.h ('k') | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698