| 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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 } | 820 } |
| 821 } | 821 } |
| 822 | 822 |
| 823 bool SchedulerStateMachine::ShouldTriggerBeginImplFrameDeadlineImmediately() | 823 bool SchedulerStateMachine::ShouldTriggerBeginImplFrameDeadlineImmediately() |
| 824 const { | 824 const { |
| 825 // TODO(brianderson): This should take into account multiple commit sources. | 825 // TODO(brianderson): This should take into account multiple commit sources. |
| 826 | 826 |
| 827 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME) | 827 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME) |
| 828 return false; | 828 return false; |
| 829 | 829 |
| 830 // If things are being aborted, end the current BeginImplFrame ASAP so we can | 830 // If we've lost the output surface, end the current BeginImplFrame ASAP |
| 831 // unblock creating the next output surface. | 831 // so we can start creating the next output surface. |
| 832 if (PendingDrawsShouldBeAborted()) | 832 if (output_surface_state_ == OUTPUT_SURFACE_LOST) |
| 833 return true; | 833 return true; |
| 834 | 834 |
| 835 // SwapAck throttle the deadline since we wont draw and swap anyway. | 835 // SwapAck throttle the deadline since we wont draw and swap anyway. |
| 836 if (pending_swaps_ >= max_pending_swaps_) | 836 if (pending_swaps_ >= max_pending_swaps_) |
| 837 return false; | 837 return false; |
| 838 | 838 |
| 839 if (active_tree_needs_first_draw_) | 839 if (active_tree_needs_first_draw_) |
| 840 return true; | 840 return true; |
| 841 | 841 |
| 842 if (!needs_redraw_) | 842 if (!needs_redraw_) |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 static_cast<int>(begin_impl_frame_state_), | 1080 static_cast<int>(begin_impl_frame_state_), |
| 1081 static_cast<int>(commit_state_), | 1081 static_cast<int>(commit_state_), |
| 1082 has_pending_tree_ ? 'T' : 'F', | 1082 has_pending_tree_ ? 'T' : 'F', |
| 1083 pending_tree_is_ready_for_activation_ ? 'T' : 'F', | 1083 pending_tree_is_ready_for_activation_ ? 'T' : 'F', |
| 1084 active_tree_needs_first_draw_ ? 'T' : 'F', | 1084 active_tree_needs_first_draw_ ? 'T' : 'F', |
| 1085 max_pending_swaps_, | 1085 max_pending_swaps_, |
| 1086 pending_swaps_); | 1086 pending_swaps_); |
| 1087 } | 1087 } |
| 1088 | 1088 |
| 1089 } // namespace cc | 1089 } // namespace cc |
| OLD | NEW |