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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

Issue 1100943003: Don't defer commit until draw if not drawing soon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | no next file » | 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 1a444c9a158168283165a077085333c7b510b15e..81376a96b017f01cb65da6e93d3735e6d1d07f4c 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -463,9 +463,20 @@ bool SchedulerStateMachine::ShouldCommit() const {
return false;
}
- // Prioritize drawing the previous commit before finishing the next commit.
- if (active_tree_needs_first_draw_)
- return false;
+ if (settings_.impl_side_painting) {
+ // Prioritize drawing the previous commit before finishing the next commit.
+ bool active_tree_first_draw_is_imminent =
+ active_tree_needs_first_draw_ &&
+ begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_IDLE &&
+ pending_swaps_ < max_pending_swaps_;
+ if (active_tree_first_draw_is_imminent)
+ return false;
+ } else {
+ // If we only have an active tree, it is incorrect to replace it
+ // before we've drawn it.
+ if (active_tree_needs_first_draw_)
+ return false;
+ }
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698