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_IMPLIES(settings_.commit_to_active_tree, | 496 DCHECK(!settings_.commit_to_active_tree || !active_tree_needs_first_draw_); |
497 !active_tree_needs_first_draw_); | |
498 | 497 |
499 return true; | 498 return true; |
500 } | 499 } |
501 | 500 |
502 bool SchedulerStateMachine::ShouldPrepareTiles() const { | 501 bool SchedulerStateMachine::ShouldPrepareTiles() const { |
503 // PrepareTiles only really needs to be called immediately after commit | 502 // PrepareTiles only really needs to be called immediately after commit |
504 // and then periodically after that. Use a funnel to make sure we average | 503 // and then periodically after that. Use a funnel to make sure we average |
505 // one PrepareTiles per BeginImplFrame in the long run. | 504 // one PrepareTiles per BeginImplFrame in the long run. |
506 if (prepare_tiles_funnel_ > 0) | 505 if (prepare_tiles_funnel_ > 0) |
507 return false; | 506 return false; |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 case OUTPUT_SURFACE_ACTIVE: | 1106 case OUTPUT_SURFACE_ACTIVE: |
1108 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1107 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
1109 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1108 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
1110 return true; | 1109 return true; |
1111 } | 1110 } |
1112 NOTREACHED(); | 1111 NOTREACHED(); |
1113 return false; | 1112 return false; |
1114 } | 1113 } |
1115 | 1114 |
1116 } // namespace cc | 1115 } // namespace cc |
OLD | NEW |