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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

Issue 822933004: cc: Trigger deadline immediately when commit is aborted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 | « no previous file | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | cc/scheduler/scheduler_unittest.cc » ('J')
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 ccf6b14e08e97b9dd8821ffc03a9be79635398aa..d8f9b1f351727a7d6dd69b7d9fd028b28840975b 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -853,34 +853,30 @@ bool SchedulerStateMachine::ShouldTriggerBeginImplFrameDeadlineImmediately()
if (output_surface_state_ == OUTPUT_SURFACE_LOST)
return true;
- // SwapAck throttle the deadline since we wont draw and swap anyway.
- if (pending_swaps_ >= max_pending_swaps_)
- return false;
+ if (needs_redraw_) {
+ // SwapAck throttle the deadline since we wont draw and swap anyway.
+ if (pending_swaps_ >= max_pending_swaps_)
brianderson 2015/01/09 23:54:22 Putting this inside the if(needs_redraw) I think w
sunnyps 2015/01/13 19:36:01 Done. The test I had to change in scheduler_state_
+ return false;
- if (active_tree_needs_first_draw_)
- return true;
+ if (active_tree_needs_first_draw_)
+ return true;
- if (!needs_redraw_)
- return false;
+ // Prioritize impl-thread draws in impl_latency_takes_priority_ mode.
+ if (impl_latency_takes_priority_)
+ return true;
+
+ // If we are on battery power and want to prioritize impl latency because
+ // we don't trust deadline tasks to execute at the right time.
+ if (impl_latency_takes_priority_on_battery_)
+ return true;
+ }
// This is used to prioritize impl-thread draws when the main thread isn't
// producing anything, e.g., after an aborted commit. We also check that we
// don't have a pending tree -- otherwise we should give it a chance to
// activate.
// TODO(skyostil): Revisit this when we have more accurate deadline estimates.
- if (commit_state_ == COMMIT_STATE_IDLE && !has_pending_tree_)
- return true;
-
- // Prioritize impl-thread draws in impl_latency_takes_priority_ mode.
- if (impl_latency_takes_priority_)
- return true;
-
- // If we are on battery power and want to prioritize impl latency because
- // we don't trust deadline tasks to execute at the right time.
- if (impl_latency_takes_priority_on_battery_)
- return true;
-
- return false;
+ return (commit_state_ == COMMIT_STATE_IDLE && !has_pending_tree_);
}
bool SchedulerStateMachine::MainThreadIsInHighLatencyMode() const {
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | cc/scheduler/scheduler_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698