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 CCSchedulerStateMachine_h | 5 #ifndef CCSchedulerStateMachine_h |
6 #define CCSchedulerStateMachine_h | 6 #define CCSchedulerStateMachine_h |
7 | 7 |
8 #include <wtf/Noncopyable.h> | 8 #include <wtf/Noncopyable.h> |
| 9 #include <wtf/text/WTFString.h> |
9 | 10 |
10 namespace WebCore { | 11 namespace WebCore { |
11 | 12 |
12 // The CCSchedulerStateMachine decides how to coordinate main thread activites | 13 // The CCSchedulerStateMachine decides how to coordinate main thread activites |
13 // like painting/running javascript with rendering and input activities on the | 14 // like painting/running javascript with rendering and input activities on the |
14 // impl thread. | 15 // impl thread. |
15 // | 16 // |
16 // The state machine tracks internal state but is also influenced by external st
ate. | 17 // The state machine tracks internal state but is also influenced by external st
ate. |
17 // Internal state includes things like whether a frame has been requested, while | 18 // Internal state includes things like whether a frame has been requested, while |
18 // external state includes things like the current time being near to the vblank
time. | 19 // external state includes things like the current time being near to the vblank
time. |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // canDraw can be used to supress flashes or checkerboarding | 122 // canDraw can be used to supress flashes or checkerboarding |
122 // when such behavior would be undesirable. | 123 // when such behavior would be undesirable. |
123 void setCanDraw(bool can) { m_canDraw = can; } | 124 void setCanDraw(bool can) { m_canDraw = can; } |
124 | 125 |
125 void didLoseContext(); | 126 void didLoseContext(); |
126 void didRecreateContext(); | 127 void didRecreateContext(); |
127 | 128 |
128 // Exposed for testing purposes. | 129 // Exposed for testing purposes. |
129 void setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int); | 130 void setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int); |
130 | 131 |
| 132 String toString(); |
| 133 |
131 protected: | 134 protected: |
132 bool shouldDrawForced() const; | 135 bool shouldDrawForced() const; |
133 bool drawSuspendedUntilCommit() const; | 136 bool drawSuspendedUntilCommit() const; |
134 bool scheduledToDraw() const; | 137 bool scheduledToDraw() const; |
135 bool shouldDraw() const; | 138 bool shouldDraw() const; |
136 bool shouldAcquireLayerTexturesForMainThread() const; | 139 bool shouldAcquireLayerTexturesForMainThread() const; |
137 bool hasDrawnThisFrame() const; | 140 bool hasDrawnThisFrame() const; |
138 | 141 |
139 CommitState m_commitState; | 142 CommitState m_commitState; |
140 | 143 |
(...skipping 13 matching lines...) Expand all Loading... |
154 bool m_canBeginFrame; | 157 bool m_canBeginFrame; |
155 bool m_canDraw; | 158 bool m_canDraw; |
156 bool m_drawIfPossibleFailed; | 159 bool m_drawIfPossibleFailed; |
157 TextureState m_textureState; | 160 TextureState m_textureState; |
158 ContextState m_contextState; | 161 ContextState m_contextState; |
159 }; | 162 }; |
160 | 163 |
161 } | 164 } |
162 | 165 |
163 #endif // CCSchedulerStateMachine_h | 166 #endif // CCSchedulerStateMachine_h |
OLD | NEW |