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 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 | 868 |
869 // If we've lost the output surface, end the current BeginImplFrame ASAP | 869 // If we've lost the output surface, end the current BeginImplFrame ASAP |
870 // so we can start creating the next output surface. | 870 // so we can start creating the next output surface. |
871 if (output_surface_state_ == OUTPUT_SURFACE_LOST) | 871 if (output_surface_state_ == OUTPUT_SURFACE_LOST) |
872 return true; | 872 return true; |
873 | 873 |
874 // SwapAck throttle the deadline since we wont draw and swap anyway. | 874 // SwapAck throttle the deadline since we wont draw and swap anyway. |
875 if (pending_swaps_ >= max_pending_swaps_) | 875 if (pending_swaps_ >= max_pending_swaps_) |
876 return false; | 876 return false; |
877 | 877 |
| 878 if (active_tree_needs_first_draw_) |
| 879 return true; |
| 880 |
| 881 if (!needs_redraw_) |
| 882 return false; |
| 883 |
878 // This is used to prioritize impl-thread draws when the main thread isn't | 884 // This is used to prioritize impl-thread draws when the main thread isn't |
879 // producing anything, e.g., after an aborted commit. We also check that we | 885 // producing anything, e.g., after an aborted commit. We also check that we |
880 // don't have a pending tree -- otherwise we should give it a chance to | 886 // don't have a pending tree -- otherwise we should give it a chance to |
881 // activate. | 887 // activate. |
882 // TODO(skyostil): Revisit this when we have more accurate deadline estimates. | 888 // TODO(skyostil): Revisit this when we have more accurate deadline estimates. |
883 if (commit_state_ == COMMIT_STATE_IDLE && !has_pending_tree_) | 889 if (commit_state_ == COMMIT_STATE_IDLE && !has_pending_tree_) |
884 return true; | 890 return true; |
885 | 891 |
886 if (!needs_redraw_) | |
887 return false; | |
888 | |
889 if (active_tree_needs_first_draw_) | |
890 return true; | |
891 | |
892 // Prioritize impl-thread draws in impl_latency_takes_priority_ mode. | 892 // Prioritize impl-thread draws in impl_latency_takes_priority_ mode. |
893 if (impl_latency_takes_priority_) | 893 if (impl_latency_takes_priority_) |
894 return true; | 894 return true; |
895 | 895 |
896 // If we are on battery power and want to prioritize impl latency because | 896 // If we are on battery power and want to prioritize impl latency because |
897 // we don't trust deadline tasks to execute at the right time. | 897 // we don't trust deadline tasks to execute at the right time. |
898 if (impl_latency_takes_priority_on_battery_) | 898 if (impl_latency_takes_priority_on_battery_) |
899 return true; | 899 return true; |
900 | 900 |
901 return false; | 901 return false; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 static_cast<int>(begin_impl_frame_state_), | 1121 static_cast<int>(begin_impl_frame_state_), |
1122 static_cast<int>(commit_state_), | 1122 static_cast<int>(commit_state_), |
1123 has_pending_tree_ ? 'T' : 'F', | 1123 has_pending_tree_ ? 'T' : 'F', |
1124 pending_tree_is_ready_for_activation_ ? 'T' : 'F', | 1124 pending_tree_is_ready_for_activation_ ? 'T' : 'F', |
1125 active_tree_needs_first_draw_ ? 'T' : 'F', | 1125 active_tree_needs_first_draw_ ? 'T' : 'F', |
1126 max_pending_swaps_, | 1126 max_pending_swaps_, |
1127 pending_swaps_); | 1127 pending_swaps_); |
1128 } | 1128 } |
1129 | 1129 |
1130 } // namespace cc | 1130 } // namespace cc |
OLD | NEW |