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 1111ba36f13c0030b50d5eb5373e563ce955815f..ba049285e79ada8762f35654957592fd5298adb5 100644 |
| --- a/cc/scheduler/scheduler_state_machine.cc |
| +++ b/cc/scheduler/scheduler_state_machine.cc |
| @@ -303,6 +303,11 @@ bool SchedulerStateMachine::PendingDrawsShouldBeAborted() const { |
| if (PendingActivationsShouldBeForced()) |
| return true; |
| + // Impl thread should not draw anymore when texture is acquired by main thread |
| + // because texture is controlled under main thread. |
| + if (texture_state_ == LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD) |
| + 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. |
| @@ -317,11 +322,6 @@ 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. |
| - // The impl thread cannot lock layer textures unless the pending |
| - // tree can be activated to unblock the commit. |
| - if (texture_state_ == LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD) |
| - return true; |
| - |
| // There is no output surface to trigger our activations. |
| if (output_surface_state_ == OUTPUT_SURFACE_LOST) |
| return true; |
| @@ -561,6 +561,10 @@ void SchedulerStateMachine::CheckInvariants() { |
| // timeout simultaneously. |
| DCHECK(!(forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW && |
| readback_state_ == READBACK_STATE_WAITING_FOR_DRAW_AND_READBACK)); |
| + // Main thread should never have the texture locked when there is a pending |
|
brianderson
2014/03/06 17:56:25
nit: line break above comment.
simonhong
2014/03/06 21:04:48
Done.
|
| + // tree. |
| + if (has_pending_tree_) |
|
brianderson
2014/03/06 17:56:25
Can you change this to:
if (has_pending_tree_ || a
simonhong
2014/03/06 21:04:48
Done.
|
| + DCHECK(texture_state_ != LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD); |
| } |
| void SchedulerStateMachine::UpdateState(Action action) { |