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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 } else { | 852 } else { |
853 // The impl thread doesn't have anything it wants to draw and we are just | 853 // The impl thread doesn't have anything it wants to draw and we are just |
854 // waiting for a new active tree or we are swap throttled. In short we are | 854 // waiting for a new active tree or we are swap throttled. In short we are |
855 // blocked. | 855 // blocked. |
856 return BEGIN_IMPL_FRAME_DEADLINE_MODE_LATE; | 856 return BEGIN_IMPL_FRAME_DEADLINE_MODE_LATE; |
857 } | 857 } |
858 } | 858 } |
859 | 859 |
860 bool SchedulerStateMachine::ShouldTriggerBeginImplFrameDeadlineImmediately() | 860 bool SchedulerStateMachine::ShouldTriggerBeginImplFrameDeadlineImmediately() |
861 const { | 861 const { |
| 862 // TODO(brianderson): This should take into account multiple commit sources. |
862 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME) | 863 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME) |
863 return false; | 864 return false; |
864 | 865 |
865 // If things are being aborted, end the current BeginImplFrame ASAP so we can | 866 // If things are being aborted, end the current BeginImplFrame ASAP so we can |
866 // unblock creating the next output surface. | 867 // unblock creating the next output surface. |
867 if (PendingDrawsShouldBeAborted()) | 868 if (PendingDrawsShouldBeAborted()) |
868 return true; | 869 return true; |
869 | 870 |
870 // SwapAck throttle the deadline since we wont draw and swap anyway. | 871 // SwapAck throttle the deadline since we wont draw and swap anyway. |
871 if (pending_swaps_ >= max_pending_swaps_) | 872 if (pending_swaps_ >= max_pending_swaps_) |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 static_cast<int>(begin_impl_frame_state_), | 1116 static_cast<int>(begin_impl_frame_state_), |
1116 static_cast<int>(commit_state_), | 1117 static_cast<int>(commit_state_), |
1117 has_pending_tree_ ? 'T' : 'F', | 1118 has_pending_tree_ ? 'T' : 'F', |
1118 pending_tree_is_ready_for_activation_ ? 'T' : 'F', | 1119 pending_tree_is_ready_for_activation_ ? 'T' : 'F', |
1119 active_tree_needs_first_draw_ ? 'T' : 'F', | 1120 active_tree_needs_first_draw_ ? 'T' : 'F', |
1120 max_pending_swaps_, | 1121 max_pending_swaps_, |
1121 pending_swaps_); | 1122 pending_swaps_); |
1122 } | 1123 } |
1123 | 1124 |
1124 } // namespace cc | 1125 } // namespace cc |
OLD | NEW |