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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void setCanDraw(bool can) { m_canDraw = can; } | 119 void setCanDraw(bool can) { m_canDraw = can; } |
120 | 120 |
121 void didLoseContext(); | 121 void didLoseContext(); |
122 void didRecreateContext(); | 122 void didRecreateContext(); |
123 | 123 |
124 // Exposed for testing purposes. | 124 // Exposed for testing purposes. |
125 void setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int); | 125 void setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int); |
126 | 126 |
127 std::string toString(); | 127 std::string toString(); |
128 | 128 |
| 129 void setSettingsJankInsteadOfCheckerboard(bool jank) { m_settingsJankInstead
OfCheckerboard = jank; } |
| 130 |
129 protected: | 131 protected: |
130 bool shouldDrawForced() const; | 132 bool shouldDrawForced() const; |
131 bool drawSuspendedUntilCommit() const; | 133 bool drawSuspendedUntilCommit() const; |
132 bool scheduledToDraw() const; | 134 bool scheduledToDraw() const; |
133 bool shouldDraw() const; | 135 bool shouldDraw() const; |
134 bool shouldAcquireLayerTexturesForMainThread() const; | 136 bool shouldAcquireLayerTexturesForMainThread() const; |
135 bool hasDrawnThisFrame() const; | 137 bool hasDrawnThisFrame() const; |
136 | 138 |
137 CommitState m_commitState; | 139 CommitState m_commitState; |
138 | 140 |
139 int m_currentFrameNumber; | 141 int m_currentFrameNumber; |
140 int m_lastFrameNumberWhereDrawWasCalled; | 142 int m_lastFrameNumberWhereDrawWasCalled; |
141 int m_consecutiveFailedDraws; | 143 int m_consecutiveFailedDraws; |
142 int m_maximumNumberOfFailedDrawsBeforeDrawIsForced; | 144 int m_maximumNumberOfFailedDrawsBeforeDrawIsForced; |
143 bool m_needsRedraw; | 145 bool m_needsRedraw; |
144 bool m_needsForcedRedraw; | 146 bool m_needsForcedRedraw; |
145 bool m_needsForcedRedrawAfterNextCommit; | 147 bool m_needsForcedRedrawAfterNextCommit; |
146 bool m_needsCommit; | 148 bool m_needsCommit; |
147 bool m_needsForcedCommit; | 149 bool m_needsForcedCommit; |
148 bool m_mainThreadNeedsLayerTextures; | 150 bool m_mainThreadNeedsLayerTextures; |
149 bool m_insideVSync; | 151 bool m_insideVSync; |
150 bool m_visible; | 152 bool m_visible; |
151 bool m_canBeginFrame; | 153 bool m_canBeginFrame; |
152 bool m_canDraw; | 154 bool m_canDraw; |
153 bool m_drawIfPossibleFailed; | 155 bool m_drawIfPossibleFailed; |
154 TextureState m_textureState; | 156 TextureState m_textureState; |
155 ContextState m_contextState; | 157 ContextState m_contextState; |
156 | 158 |
| 159 bool m_settingsJankInsteadOfCheckerboard; |
| 160 |
157 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 161 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
158 }; | 162 }; |
159 | 163 |
160 } | 164 } |
161 | 165 |
162 #endif // CC_SCHEDULER_STATE_MACHINE_H_ | 166 #endif // CC_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |