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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 bool smoothness_takes_priority) { | 1031 bool smoothness_takes_priority) { |
1032 smoothness_takes_priority_ = smoothness_takes_priority; | 1032 smoothness_takes_priority_ = smoothness_takes_priority; |
1033 } | 1033 } |
1034 | 1034 |
1035 void SchedulerStateMachine::DidDrawIfPossibleCompleted( | 1035 void SchedulerStateMachine::DidDrawIfPossibleCompleted( |
1036 DrawSwapReadbackResult::DrawResult result) { | 1036 DrawSwapReadbackResult::DrawResult result) { |
1037 switch (result) { | 1037 switch (result) { |
1038 case DrawSwapReadbackResult::INVALID_RESULT: | 1038 case DrawSwapReadbackResult::INVALID_RESULT: |
1039 NOTREACHED() << "Uninitialized DrawSwapReadbackResult."; | 1039 NOTREACHED() << "Uninitialized DrawSwapReadbackResult."; |
1040 break; | 1040 break; |
| 1041 case DrawSwapReadbackResult::DRAW_ABORTED_CANT_DRAW: |
| 1042 case DrawSwapReadbackResult::DRAW_ABORTED_CANT_READBACK: |
| 1043 case DrawSwapReadbackResult::DRAW_ABORTED_CONTEXT_LOST: |
| 1044 NOTREACHED() << "Invalid return value from DrawAndSwapIfPossible:" |
| 1045 << result; |
| 1046 break; |
1041 case DrawSwapReadbackResult::DRAW_SUCCESS: | 1047 case DrawSwapReadbackResult::DRAW_SUCCESS: |
1042 consecutive_checkerboard_animations_ = 0; | 1048 consecutive_checkerboard_animations_ = 0; |
1043 forced_redraw_state_ = FORCED_REDRAW_STATE_IDLE; | 1049 forced_redraw_state_ = FORCED_REDRAW_STATE_IDLE; |
1044 break; | 1050 break; |
1045 case DrawSwapReadbackResult::DRAW_ABORTED_CHECKERBOARD_ANIMATIONS: | 1051 case DrawSwapReadbackResult::DRAW_ABORTED_CHECKERBOARD_ANIMATIONS: |
1046 needs_redraw_ = true; | 1052 needs_redraw_ = true; |
1047 | 1053 |
1048 // If we're already in the middle of a redraw, we don't need to | 1054 // If we're already in the middle of a redraw, we don't need to |
1049 // restart it. | 1055 // restart it. |
1050 if (forced_redraw_state_ != FORCED_REDRAW_STATE_IDLE) | 1056 if (forced_redraw_state_ != FORCED_REDRAW_STATE_IDLE) |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 case OUTPUT_SURFACE_ACTIVE: | 1157 case OUTPUT_SURFACE_ACTIVE: |
1152 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1158 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
1153 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1159 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
1154 return true; | 1160 return true; |
1155 } | 1161 } |
1156 NOTREACHED(); | 1162 NOTREACHED(); |
1157 return false; | 1163 return false; |
1158 } | 1164 } |
1159 | 1165 |
1160 } // namespace cc | 1166 } // namespace cc |
OLD | NEW |