| 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/values.h" | 10 #include "base/values.h" |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 // If the pending tree activates quickly, we'll want a BeginFrame soon | 762 // If the pending tree activates quickly, we'll want a BeginFrame soon |
| 763 // to draw the new active tree. | 763 // to draw the new active tree. |
| 764 if (has_pending_tree_) | 764 if (has_pending_tree_) |
| 765 return true; | 765 return true; |
| 766 | 766 |
| 767 // Changing priorities may allow us to activate (given the new priorities), | 767 // Changing priorities may allow us to activate (given the new priorities), |
| 768 // which may result in a new frame. | 768 // which may result in a new frame. |
| 769 if (needs_manage_tiles_) | 769 if (needs_manage_tiles_) |
| 770 return true; | 770 return true; |
| 771 | 771 |
| 772 // If we just swapped, it's likely that we are going to produce another |
| 773 // frame soon. This helps avoid negative glitches in our SetNeedsBeginFrame |
| 774 // requests, which may propagate to the BeginFrame provider and get sampled |
| 775 // at an inopportune time, delaying the next BeginFrame. |
| 776 if (last_frame_number_swap_performed_ == current_frame_number_) |
| 777 return true; |
| 778 |
| 772 return false; | 779 return false; |
| 773 } | 780 } |
| 774 | 781 |
| 775 void SchedulerStateMachine::DidEnterBeginFrame(const BeginFrameArgs& args) { | 782 void SchedulerStateMachine::DidEnterBeginFrame(const BeginFrameArgs& args) { |
| 776 current_frame_number_++; | 783 current_frame_number_++; |
| 777 inside_begin_frame_ = true; | 784 inside_begin_frame_ = true; |
| 778 last_begin_frame_args_ = args; | 785 last_begin_frame_args_ = args; |
| 779 } | 786 } |
| 780 | 787 |
| 781 void SchedulerStateMachine::DidLeaveBeginFrame() { | 788 void SchedulerStateMachine::DidLeaveBeginFrame() { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 case OUTPUT_SURFACE_ACTIVE: | 906 case OUTPUT_SURFACE_ACTIVE: |
| 900 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 907 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
| 901 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 908 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
| 902 return true; | 909 return true; |
| 903 } | 910 } |
| 904 NOTREACHED(); | 911 NOTREACHED(); |
| 905 return false; | 912 return false; |
| 906 } | 913 } |
| 907 | 914 |
| 908 } // namespace cc | 915 } // namespace cc |
| OLD | NEW |