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/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 // READBACK_STATE_WAITING_FOR_COMMIT | 1097 // READBACK_STATE_WAITING_FOR_COMMIT |
1098 if (commit_state_ == COMMIT_STATE_BEGIN_MAIN_FRAME_SENT) { | 1098 if (commit_state_ == COMMIT_STATE_BEGIN_MAIN_FRAME_SENT) { |
1099 readback_state_ = READBACK_STATE_WAITING_FOR_COMMIT; | 1099 readback_state_ = READBACK_STATE_WAITING_FOR_COMMIT; |
1100 } else { | 1100 } else { |
1101 // Set needs_commit_ to true to trigger scheduling BeginMainFrame(). | 1101 // Set needs_commit_ to true to trigger scheduling BeginMainFrame(). |
1102 needs_commit_ = true; | 1102 needs_commit_ = true; |
1103 readback_state_ = READBACK_STATE_NEEDS_BEGIN_MAIN_FRAME; | 1103 readback_state_ = READBACK_STATE_NEEDS_BEGIN_MAIN_FRAME; |
1104 } | 1104 } |
1105 } | 1105 } |
1106 | 1106 |
1107 void SchedulerStateMachine::FinishCommit() { | 1107 void SchedulerStateMachine::NotifyReadyToCommit() { |
1108 DCHECK(commit_state_ == COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED) << *AsValue(); | 1108 DCHECK(commit_state_ == COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED) << *AsValue(); |
1109 commit_state_ = COMMIT_STATE_READY_TO_COMMIT; | 1109 commit_state_ = COMMIT_STATE_READY_TO_COMMIT; |
1110 } | 1110 } |
1111 | 1111 |
1112 void SchedulerStateMachine::BeginMainFrameAborted(bool did_handle) { | 1112 void SchedulerStateMachine::BeginMainFrameAborted(bool did_handle) { |
1113 DCHECK_EQ(commit_state_, COMMIT_STATE_BEGIN_MAIN_FRAME_SENT); | 1113 DCHECK_EQ(commit_state_, COMMIT_STATE_BEGIN_MAIN_FRAME_SENT); |
1114 if (did_handle) { | 1114 if (did_handle) { |
1115 bool commit_was_aborted = true; | 1115 bool commit_was_aborted = true; |
1116 UpdateStateOnCommit(commit_was_aborted); | 1116 UpdateStateOnCommit(commit_was_aborted); |
1117 } else { | 1117 } else { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 case OUTPUT_SURFACE_ACTIVE: | 1166 case OUTPUT_SURFACE_ACTIVE: |
1167 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1167 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
1168 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1168 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
1169 return true; | 1169 return true; |
1170 } | 1170 } |
1171 NOTREACHED(); | 1171 NOTREACHED(); |
1172 return false; | 1172 return false; |
1173 } | 1173 } |
1174 | 1174 |
1175 } // namespace cc | 1175 } // namespace cc |
OLD | NEW |