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/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
500 bool SchedulerStateMachine::ShouldCommit() const { | 500 bool SchedulerStateMachine::ShouldCommit() const { |
501 return commit_state_ == COMMIT_STATE_READY_TO_COMMIT; | 501 return commit_state_ == COMMIT_STATE_READY_TO_COMMIT; |
502 } | 502 } |
503 | 503 |
504 bool SchedulerStateMachine::IsCommitStateWaiting() const { | 504 bool SchedulerStateMachine::IsCommitStateWaiting() const { |
505 return commit_state_ == COMMIT_STATE_FRAME_IN_PROGRESS; | 505 return commit_state_ == COMMIT_STATE_FRAME_IN_PROGRESS; |
506 } | 506 } |
507 | 507 |
508 bool SchedulerStateMachine::ShouldManageTiles() const { | 508 bool SchedulerStateMachine::ShouldManageTiles() const { |
509 // ManageTiles only really needs to be called immediately after commit | 509 // ManageTiles only really needs to be called immediately after commit |
510 // and then periodically after that. Limiting to once per frame prevents | 510 // and then periodically after that. Limiting to every other frame prevents |
enne (OOO)
2014/01/15 19:26:44
Maybe I'm misunderstanding, but I don't think this
brianderson
2014/01/15 19:39:09
It's mainly a problem when the main thread is in t
| |
511 // post-commit and post-draw ManageTiles on the same frame. | 511 // post-commit and post-draw ManageTiles on the same frame. |
512 if (last_frame_number_manage_tiles_called_ == current_frame_number_) | 512 if (last_frame_number_manage_tiles_called_ + 1 >= current_frame_number_) |
513 return false; | 513 return false; |
514 | 514 |
515 // Limiting to once per-frame is not enough, since we only want to | 515 // Limiting to once per-frame is not enough, since we only want to |
516 // manage tiles _after_ draws. Polling for draw triggers and | 516 // manage tiles _after_ draws. Polling for draw triggers and |
517 // begin-frame are mutually exclusive, so we limit to these two cases. | 517 // begin-frame are mutually exclusive, so we limit to these two cases. |
518 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE && | 518 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE && |
519 !inside_poll_for_anticipated_draw_triggers_) | 519 !inside_poll_for_anticipated_draw_triggers_) |
520 return false; | 520 return false; |
521 return needs_manage_tiles_; | 521 return needs_manage_tiles_; |
522 } | 522 } |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1119 case OUTPUT_SURFACE_ACTIVE: | 1119 case OUTPUT_SURFACE_ACTIVE: |
1120 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1120 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
1121 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1121 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
1122 return true; | 1122 return true; |
1123 } | 1123 } |
1124 NOTREACHED(); | 1124 NOTREACHED(); |
1125 return false; | 1125 return false; |
1126 } | 1126 } |
1127 | 1127 |
1128 } // namespace cc | 1128 } // namespace cc |
OLD | NEW |