| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/scheduler/scheduler_state_machine.h" | 5 #include "cc/scheduler/scheduler_state_machine.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 358 |
| 359 // Do not queue too many swaps. | 359 // Do not queue too many swaps. |
| 360 if (SwapThrottled()) | 360 if (SwapThrottled()) |
| 361 return false; | 361 return false; |
| 362 | 362 |
| 363 // Except for the cases above, do not draw outside of the BeginImplFrame | 363 // Except for the cases above, do not draw outside of the BeginImplFrame |
| 364 // deadline. | 364 // deadline. |
| 365 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE) | 365 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE) |
| 366 return false; | 366 return false; |
| 367 | 367 |
| 368 if (wait_for_ready_to_draw_) | |
| 369 return false; | |
| 370 | |
| 371 // Only handle forced redraws due to timeouts on the regular deadline. | 368 // Only handle forced redraws due to timeouts on the regular deadline. |
| 372 if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW) | 369 if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW) |
| 373 return true; | 370 return true; |
| 374 | 371 |
| 375 return needs_redraw_; | 372 return needs_redraw_; |
| 376 } | 373 } |
| 377 | 374 |
| 378 bool SchedulerStateMachine::ShouldActivatePendingTree() const { | 375 bool SchedulerStateMachine::ShouldActivatePendingTree() const { |
| 379 // There is nothing to activate. | 376 // There is nothing to activate. |
| 380 if (!has_pending_tree_) | 377 if (!has_pending_tree_) |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 case OUTPUT_SURFACE_ACTIVE: | 1106 case OUTPUT_SURFACE_ACTIVE: |
| 1110 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1107 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
| 1111 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1108 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
| 1112 return true; | 1109 return true; |
| 1113 } | 1110 } |
| 1114 NOTREACHED(); | 1111 NOTREACHED(); |
| 1115 return false; | 1112 return false; |
| 1116 } | 1113 } |
| 1117 | 1114 |
| 1118 } // namespace cc | 1115 } // namespace cc |
| OLD | NEW |