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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 return false; | 486 return false; |
487 | 487 |
488 // We must not finish the commit until the pending tree is free. | 488 // We must not finish the commit until the pending tree is free. |
489 if (has_pending_tree_) { | 489 if (has_pending_tree_) { |
490 DCHECK(settings_.main_frame_before_activation_enabled); | 490 DCHECK(settings_.main_frame_before_activation_enabled); |
491 return false; | 491 return false; |
492 } | 492 } |
493 | 493 |
494 // If we only have an active tree, it is incorrect to replace it | 494 // If we only have an active tree, it is incorrect to replace it |
495 // before we've drawn it. | 495 // before we've drawn it. |
496 DCHECK(!settings_.commit_to_active_tree || !active_tree_needs_first_draw_); | 496 DCHECK_IMPLIES(settings_.commit_to_active_tree, |
| 497 !active_tree_needs_first_draw_); |
497 | 498 |
498 return true; | 499 return true; |
499 } | 500 } |
500 | 501 |
501 bool SchedulerStateMachine::ShouldPrepareTiles() const { | 502 bool SchedulerStateMachine::ShouldPrepareTiles() const { |
502 // PrepareTiles only really needs to be called immediately after commit | 503 // PrepareTiles only really needs to be called immediately after commit |
503 // and then periodically after that. Use a funnel to make sure we average | 504 // and then periodically after that. Use a funnel to make sure we average |
504 // one PrepareTiles per BeginImplFrame in the long run. | 505 // one PrepareTiles per BeginImplFrame in the long run. |
505 if (prepare_tiles_funnel_ > 0) | 506 if (prepare_tiles_funnel_ > 0) |
506 return false; | 507 return false; |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 case OUTPUT_SURFACE_ACTIVE: | 1107 case OUTPUT_SURFACE_ACTIVE: |
1107 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1108 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
1108 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1109 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
1109 return true; | 1110 return true; |
1110 } | 1111 } |
1111 NOTREACHED(); | 1112 NOTREACHED(); |
1112 return false; | 1113 return false; |
1113 } | 1114 } |
1114 | 1115 |
1115 } // namespace cc | 1116 } // namespace cc |
OLD | NEW |