| 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 <string> |
| 8 #include <wtf/Noncopyable.h> | 9 #include <wtf/Noncopyable.h> |
| 9 #include <wtf/text/WTFString.h> | |
| 10 | 10 |
| 11 namespace WebCore { | 11 namespace WebCore { |
| 12 | 12 |
| 13 // The CCSchedulerStateMachine decides how to coordinate main thread activites | 13 // The CCSchedulerStateMachine decides how to coordinate main thread activites |
| 14 // like painting/running javascript with rendering and input activities on the | 14 // like painting/running javascript with rendering and input activities on the |
| 15 // impl thread. | 15 // impl thread. |
| 16 // | 16 // |
| 17 // 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. |
| 18 // 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 |
| 19 // 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... |
| 122 // canDraw can be used to supress flashes or checkerboarding | 122 // canDraw can be used to supress flashes or checkerboarding |
| 123 // when such behavior would be undesirable. | 123 // when such behavior would be undesirable. |
| 124 void setCanDraw(bool can) { m_canDraw = can; } | 124 void setCanDraw(bool can) { m_canDraw = can; } |
| 125 | 125 |
| 126 void didLoseContext(); | 126 void didLoseContext(); |
| 127 void didRecreateContext(); | 127 void didRecreateContext(); |
| 128 | 128 |
| 129 // Exposed for testing purposes. | 129 // Exposed for testing purposes. |
| 130 void setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int); | 130 void setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int); |
| 131 | 131 |
| 132 String toString(); | 132 std::string toString(); |
| 133 | 133 |
| 134 protected: | 134 protected: |
| 135 bool shouldDrawForced() const; | 135 bool shouldDrawForced() const; |
| 136 bool drawSuspendedUntilCommit() const; | 136 bool drawSuspendedUntilCommit() const; |
| 137 bool scheduledToDraw() const; | 137 bool scheduledToDraw() const; |
| 138 bool shouldDraw() const; | 138 bool shouldDraw() const; |
| 139 bool shouldAcquireLayerTexturesForMainThread() const; | 139 bool shouldAcquireLayerTexturesForMainThread() const; |
| 140 bool hasDrawnThisFrame() const; | 140 bool hasDrawnThisFrame() const; |
| 141 | 141 |
| 142 CommitState m_commitState; | 142 CommitState m_commitState; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 157 bool m_canBeginFrame; | 157 bool m_canBeginFrame; |
| 158 bool m_canDraw; | 158 bool m_canDraw; |
| 159 bool m_drawIfPossibleFailed; | 159 bool m_drawIfPossibleFailed; |
| 160 TextureState m_textureState; | 160 TextureState m_textureState; |
| 161 ContextState m_contextState; | 161 ContextState m_contextState; |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 } | 164 } |
| 165 | 165 |
| 166 #endif // CCSchedulerStateMachine_h | 166 #endif // CCSchedulerStateMachine_h |
| OLD | NEW |