Chromium Code Reviews| Index: cc/scheduler/scheduler_state_machine.cc |
| diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc |
| index 8f38a33d7e31f7299dac0afa87a939b61ce86b8b..5f96faf499574ff7abfaea0e2c674d8a5db7387b 100644 |
| --- a/cc/scheduler/scheduler_state_machine.cc |
| +++ b/cc/scheduler/scheduler_state_machine.cc |
| @@ -282,23 +282,28 @@ bool SchedulerStateMachine::PendingDrawsShouldBeAborted() const { |
| return true; |
| // Additional states where we should abort draws. |
| - // Note: We don't force activation in these cases because doing so would |
| - // result in checkerboarding on resize, becoming visible, etc. |
| if (!can_draw_) |
|
brianderson
2014/09/25 20:07:42
Do we also set the high res required to draw flag
danakj
2014/09/25 20:16:07
That's a good question. We recently had to add a S
|
| return true; |
| - if (!visible_) |
| - return true; |
| return false; |
| } |
| bool SchedulerStateMachine::PendingActivationsShouldBeForced() const { |
| - // These are all the cases where, if we do not force activations to make |
| - // forward progress, we might deadlock with the main thread. |
| - |
| // There is no output surface to trigger our activations. |
| + // If we do not force activations to make forward progress, we might deadlock |
| + // with the main thread. |
| if (output_surface_state_ == OUTPUT_SURFACE_LOST) |
| return true; |
| + // If we're not visible, we should force activation. |
| + // Since we set RequiresHighResToDraw when becoming visible, we ensure that we |
| + // don't checkerboard until all visible resources are done. Furthermore, if we |
| + // do keep the pending tree around, when becoming visible we might activate |
| + // prematurely causing RequiresHighResToDraw flag to be reset. In all cases, |
| + // we can simply activate on becoming invisible since we don't need to draw |
| + // the active tree when we're in this state. |
| + if (!visible_) |
| + return true; |
| + |
| return false; |
| } |