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 { |