| 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 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 return BEGIN_IMPL_FRAME_DEADLINE_MODE_LATE; | 865 return BEGIN_IMPL_FRAME_DEADLINE_MODE_LATE; |
| 866 } | 866 } |
| 867 } | 867 } |
| 868 | 868 |
| 869 bool SchedulerStateMachine::ShouldTriggerBeginImplFrameDeadlineImmediately() | 869 bool SchedulerStateMachine::ShouldTriggerBeginImplFrameDeadlineImmediately() |
| 870 const { | 870 const { |
| 871 // TODO(brianderson): This should take into account multiple commit sources. | 871 // TODO(brianderson): This should take into account multiple commit sources. |
| 872 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME) | 872 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME) |
| 873 return false; | 873 return false; |
| 874 | 874 |
| 875 // If we've lost the output surface, end the current BeginImplFrame ASAP | 875 // If things are being aborted, end the current BeginImplFrame ASAP so we can |
| 876 // so we can start creating the next output surface. | 876 // unblock creating the next output surface. |
| 877 if (output_surface_state_ == OUTPUT_SURFACE_LOST) | 877 if (PendingDrawsShouldBeAborted()) |
| 878 return true; | 878 return true; |
| 879 | 879 |
| 880 // SwapAck throttle the deadline since we wont draw and swap anyway. | 880 // SwapAck throttle the deadline since we wont draw and swap anyway. |
| 881 if (pending_swaps_ >= max_pending_swaps_) | 881 if (pending_swaps_ >= max_pending_swaps_) |
| 882 return false; | 882 return false; |
| 883 | 883 |
| 884 if (active_tree_needs_first_draw_) | 884 if (active_tree_needs_first_draw_) |
| 885 return true; | 885 return true; |
| 886 | 886 |
| 887 if (!needs_redraw_) | 887 if (!needs_redraw_) |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 static_cast<int>(begin_impl_frame_state_), | 1125 static_cast<int>(begin_impl_frame_state_), |
| 1126 static_cast<int>(commit_state_), | 1126 static_cast<int>(commit_state_), |
| 1127 has_pending_tree_ ? 'T' : 'F', | 1127 has_pending_tree_ ? 'T' : 'F', |
| 1128 pending_tree_is_ready_for_activation_ ? 'T' : 'F', | 1128 pending_tree_is_ready_for_activation_ ? 'T' : 'F', |
| 1129 active_tree_needs_first_draw_ ? 'T' : 'F', | 1129 active_tree_needs_first_draw_ ? 'T' : 'F', |
| 1130 max_pending_swaps_, | 1130 max_pending_swaps_, |
| 1131 pending_swaps_); | 1131 pending_swaps_); |
| 1132 } | 1132 } |
| 1133 | 1133 |
| 1134 } // namespace cc | 1134 } // namespace cc |
| OLD | NEW |