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 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 | 1028 |
1029 void SchedulerStateMachine::SetNeedsBeginMainFrame() { | 1029 void SchedulerStateMachine::SetNeedsBeginMainFrame() { |
1030 needs_begin_main_frame_ = true; | 1030 needs_begin_main_frame_ = true; |
1031 } | 1031 } |
1032 | 1032 |
1033 void SchedulerStateMachine::SetNeedsOneBeginImplFrame() { | 1033 void SchedulerStateMachine::SetNeedsOneBeginImplFrame() { |
1034 needs_one_begin_impl_frame_ = true; | 1034 needs_one_begin_impl_frame_ = true; |
1035 } | 1035 } |
1036 | 1036 |
1037 void SchedulerStateMachine::NotifyReadyToCommit() { | 1037 void SchedulerStateMachine::NotifyReadyToCommit() { |
1038 DCHECK(begin_main_frame_state_ == BEGIN_MAIN_FRAME_STATE_STARTED) | 1038 DCHECK_EQ(begin_main_frame_state_, BEGIN_MAIN_FRAME_STATE_STARTED) |
1039 << AsValue()->ToString(); | 1039 << AsValue()->ToString(); |
1040 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_READY_TO_COMMIT; | 1040 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_READY_TO_COMMIT; |
1041 // In commit_to_active_tree mode, commit should happen right after | 1041 // In commit_to_active_tree mode, commit should happen right after |
1042 // BeginFrame, meaning when this function is called, next action should be | 1042 // BeginFrame, meaning when this function is called, next action should be |
1043 // commit. | 1043 // commit. |
1044 if (settings_.commit_to_active_tree) | 1044 if (settings_.commit_to_active_tree) |
1045 DCHECK(ShouldCommit()); | 1045 DCHECK(ShouldCommit()); |
1046 } | 1046 } |
1047 | 1047 |
1048 void SchedulerStateMachine::BeginMainFrameAborted(CommitEarlyOutReason reason) { | 1048 void SchedulerStateMachine::BeginMainFrameAborted(CommitEarlyOutReason reason) { |
1049 DCHECK_EQ(begin_main_frame_state_, BEGIN_MAIN_FRAME_STATE_SENT); | 1049 DCHECK_EQ(begin_main_frame_state_, BEGIN_MAIN_FRAME_STATE_STARTED); |
1050 switch (reason) { | 1050 switch (reason) { |
1051 case CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST: | 1051 case CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST: |
1052 case CommitEarlyOutReason::ABORTED_NOT_VISIBLE: | 1052 case CommitEarlyOutReason::ABORTED_NOT_VISIBLE: |
1053 case CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT: | 1053 case CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT: |
1054 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_IDLE; | 1054 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_IDLE; |
1055 SetNeedsBeginMainFrame(); | 1055 SetNeedsBeginMainFrame(); |
1056 return; | 1056 return; |
1057 case CommitEarlyOutReason::FINISHED_NO_UPDATES: | 1057 case CommitEarlyOutReason::FINISHED_NO_UPDATES: |
1058 bool commit_has_no_updates = true; | 1058 bool commit_has_no_updates = true; |
1059 WillCommit(commit_has_no_updates); | 1059 WillCommit(commit_has_no_updates); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 case OUTPUT_SURFACE_ACTIVE: | 1114 case OUTPUT_SURFACE_ACTIVE: |
1115 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1115 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
1116 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1116 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
1117 return true; | 1117 return true; |
1118 } | 1118 } |
1119 NOTREACHED(); | 1119 NOTREACHED(); |
1120 return false; | 1120 return false; |
1121 } | 1121 } |
1122 | 1122 |
1123 } // namespace cc | 1123 } // namespace cc |
OLD | NEW |