| 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 #ifndef CC_SCHEDULER_STATE_MACHINE_H_ | 5 #ifndef CC_SCHEDULER_STATE_MACHINE_H_ |
| 6 #define CC_SCHEDULER_STATE_MACHINE_H_ | 6 #define CC_SCHEDULER_STATE_MACHINE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // make testing cleaner. | 24 // make testing cleaner. |
| 25 class CC_EXPORT SchedulerStateMachine { | 25 class CC_EXPORT SchedulerStateMachine { |
| 26 public: | 26 public: |
| 27 SchedulerStateMachine(); | 27 SchedulerStateMachine(); |
| 28 | 28 |
| 29 enum CommitState { | 29 enum CommitState { |
| 30 COMMIT_STATE_IDLE, | 30 COMMIT_STATE_IDLE, |
| 31 COMMIT_STATE_FRAME_IN_PROGRESS, | 31 COMMIT_STATE_FRAME_IN_PROGRESS, |
| 32 COMMIT_STATE_READY_TO_COMMIT, | 32 COMMIT_STATE_READY_TO_COMMIT, |
| 33 COMMIT_STATE_WAITING_FOR_FIRST_DRAW, | 33 COMMIT_STATE_WAITING_FOR_FIRST_DRAW, |
| 34 }; | 34 COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW, |
| 35 }; |
| 35 | 36 |
| 36 enum TextureState { | 37 enum TextureState { |
| 37 LAYER_TEXTURE_STATE_UNLOCKED, | 38 LAYER_TEXTURE_STATE_UNLOCKED, |
| 38 LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD, | 39 LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD, |
| 39 LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD, | 40 LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD, |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 enum OutputSurfaceState { | 43 enum OutputSurfaceState { |
| 43 OUTPUT_SURFACE_ACTIVE, | 44 OUTPUT_SURFACE_ACTIVE, |
| 44 OUTPUT_SURFACE_LOST, | 45 OUTPUT_SURFACE_LOST, |
| 45 OUTPUT_SURFACE_RECREATING, | 46 OUTPUT_SURFACE_RECREATING, |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 bool commitPending() const | 49 bool commitPending() const |
| 49 { | 50 { |
| 50 return m_commitState != COMMIT_STATE_IDLE; | 51 return m_commitState == COMMIT_STATE_FRAME_IN_PROGRESS || |
| 52 m_commitState == COMMIT_STATE_READY_TO_COMMIT; |
| 51 } | 53 } |
| 52 | 54 |
| 53 bool redrawPending() const { return m_needsRedraw; } | 55 bool redrawPending() const { return m_needsRedraw; } |
| 54 | 56 |
| 55 enum Action { | 57 enum Action { |
| 56 ACTION_NONE, | 58 ACTION_NONE, |
| 57 ACTION_BEGIN_FRAME, | 59 ACTION_BEGIN_FRAME, |
| 58 ACTION_COMMIT, | 60 ACTION_COMMIT, |
| 59 ACTION_DRAW_IF_POSSIBLE, | 61 ACTION_DRAW_IF_POSSIBLE, |
| 60 ACTION_DRAW_FORCED, | 62 ACTION_DRAW_FORCED, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 bool m_drawIfPossibleFailed; | 158 bool m_drawIfPossibleFailed; |
| 157 TextureState m_textureState; | 159 TextureState m_textureState; |
| 158 OutputSurfaceState m_outputSurfaceState; | 160 OutputSurfaceState m_outputSurfaceState; |
| 159 | 161 |
| 160 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 162 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
| 161 }; | 163 }; |
| 162 | 164 |
| 163 } | 165 } |
| 164 | 166 |
| 165 #endif // CC_SCHEDULER_STATE_MACHINE_H_ | 167 #endif // CC_SCHEDULER_STATE_MACHINE_H_ |
| OLD | NEW |