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/debug/trace_event_argument.h" | 8 #include "base/debug/trace_event_argument.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 if (commit_state_ != COMMIT_STATE_IDLE) | 415 if (commit_state_ != COMMIT_STATE_IDLE) |
416 return false; | 416 return false; |
417 | 417 |
418 // Don't send BeginMainFrame early if we are prioritizing the active tree | 418 // Don't send BeginMainFrame early if we are prioritizing the active tree |
419 // because of impl_latency_takes_priority_. | 419 // because of impl_latency_takes_priority_. |
420 if (impl_latency_takes_priority_ && | 420 if (impl_latency_takes_priority_ && |
421 (has_pending_tree_ || active_tree_needs_first_draw_)) { | 421 (has_pending_tree_ || active_tree_needs_first_draw_)) { |
422 return false; | 422 return false; |
423 } | 423 } |
424 | 424 |
425 // We want to start the first commit after we get a new output surface ASAP. | |
426 if (output_surface_state_ == OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT) | |
427 return true; | |
428 | |
429 // We should not send BeginMainFrame while we are in | 425 // We should not send BeginMainFrame while we are in |
430 // BEGIN_IMPL_FRAME_STATE_IDLE since we might have new | 426 // BEGIN_IMPL_FRAME_STATE_IDLE since we might have new |
431 // user input arriving soon. | 427 // user input arriving soon. |
432 // TODO(brianderson): Allow sending BeginMainFrame while idle when the main | 428 // TODO(brianderson): Allow sending BeginMainFrame while idle when the main |
433 // thread isn't consuming user input. | 429 // thread isn't consuming user input. |
434 if (begin_impl_frame_state_ == BEGIN_IMPL_FRAME_STATE_IDLE && | 430 if (begin_impl_frame_state_ == BEGIN_IMPL_FRAME_STATE_IDLE && |
435 BeginFrameNeeded()) | 431 BeginFrameNeeded()) |
436 return false; | 432 return false; |
437 | 433 |
438 // We need a new commit for the forced redraw. This honors the | 434 // We need a new commit for the forced redraw. This honors the |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 static_cast<int>(begin_impl_frame_state_), | 1059 static_cast<int>(begin_impl_frame_state_), |
1064 static_cast<int>(commit_state_), | 1060 static_cast<int>(commit_state_), |
1065 has_pending_tree_ ? 'T' : 'F', | 1061 has_pending_tree_ ? 'T' : 'F', |
1066 pending_tree_is_ready_for_activation_ ? 'T' : 'F', | 1062 pending_tree_is_ready_for_activation_ ? 'T' : 'F', |
1067 active_tree_needs_first_draw_ ? 'T' : 'F', | 1063 active_tree_needs_first_draw_ ? 'T' : 'F', |
1068 max_pending_swaps_, | 1064 max_pending_swaps_, |
1069 pending_swaps_); | 1065 pending_swaps_); |
1070 } | 1066 } |
1071 | 1067 |
1072 } // namespace cc | 1068 } // namespace cc |
OLD | NEW |