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_SCHEDULER_STATE_MACHINE_H_ | 5 #ifndef CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 6 #define CC_SCHEDULER_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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 void DidSwapUseIncompleteTile(); | 95 void DidSwapUseIncompleteTile(); |
96 | 96 |
97 // Indicates whether ACTION_DRAW_IF_POSSIBLE drew to the screen or not. | 97 // Indicates whether ACTION_DRAW_IF_POSSIBLE drew to the screen or not. |
98 void DidDrawIfPossibleCompleted(bool success); | 98 void DidDrawIfPossibleCompleted(bool success); |
99 | 99 |
100 // Indicates that a new commit flow needs to be performed, either to pull | 100 // Indicates that a new commit flow needs to be performed, either to pull |
101 // updates from the main thread to the impl, or to push deltas from the impl | 101 // updates from the main thread to the impl, or to push deltas from the impl |
102 // thread to main. | 102 // thread to main. |
103 void SetNeedsCommit(); | 103 void SetNeedsCommit(); |
104 | 104 |
105 // As SetNeedsCommit(), but ensures the beginFrame will definitely happen even | 105 // As SetNeedsCommit(), but ensures the BeginFrame will definitely happen even |
106 // if we are not visible. After this call we expect to go through the forced | 106 // if we are not visible. After this call we expect to go through the forced |
107 // commit flow and then return to waiting for a non-forced beginFrame to | 107 // commit flow and then return to waiting for a non-forced BeginFrame to |
108 // finish. | 108 // finish. |
109 void SetNeedsForcedCommit(); | 109 void SetNeedsForcedCommit(); |
110 | 110 |
111 // Call this only in response to receiving an ACTION_BEGIN_FRAME | 111 // Call this only in response to receiving an ACTION_BEGIN_FRAME |
112 // from nextState. Indicates that all painting is complete. | 112 // from NextAction. Indicates that all painting is complete. |
113 void BeginFrameComplete(); | 113 void BeginFrameComplete(); |
114 | 114 |
115 // Call this only in response to receiving an ACTION_BEGIN_FRAME | 115 // Call this only in response to receiving an ACTION_BEGIN_FRAME |
116 // from nextState if the client rejects the beginFrame message. | 116 // from NextAction if the client rejects the BeginFrame message. |
117 void BeginFrameAborted(); | 117 void BeginFrameAborted(); |
118 | 118 |
119 // Request exclusive access to the textures that back single buffered | 119 // Request exclusive access to the textures that back single buffered |
120 // layers on behalf of the main thread. Upon acquisition, | 120 // layers on behalf of the main thread. Upon acquisition, |
121 // ACTION_DRAW_IF_POSSIBLE will not draw until the main thread releases the | 121 // ACTION_DRAW_IF_POSSIBLE will not draw until the main thread releases the |
122 // textures to the impl thread by committing the layers. | 122 // textures to the impl thread by committing the layers. |
123 void SetMainThreadNeedsLayerTextures(); | 123 void SetMainThreadNeedsLayerTextures(); |
124 | 124 |
125 // Indicates whether we can successfully begin a frame at this time. | 125 // Indicates whether we can successfully begin a frame at this time. |
126 void SetCanBeginFrame(bool can) { can_begin_frame_ = can; } | 126 void SetCanBeginFrame(bool can) { can_begin_frame_ = can; } |
127 | 127 |
128 // Indicates whether drawing would, at this time, make sense. | 128 // Indicates whether drawing would, at this time, make sense. |
129 // canDraw can be used to supress flashes or checkerboarding | 129 // CanDraw can be used to supress flashes or checkerboarding |
130 // when such behavior would be undesirable. | 130 // when such behavior would be undesirable. |
131 void SetCanDraw(bool can); | 131 void SetCanDraw(bool can); |
132 | 132 |
133 // Indicates whether or not there is a pending tree. This influences | 133 // Indicates whether or not there is a pending tree. This influences |
134 // whether or not we can succesfully commit at this time. If the | 134 // whether or not we can succesfully commit at this time. If the |
135 // last commit is still being processed (but not blocking), it may not | 135 // last commit is still being processed (but not blocking), it may not |
136 // be possible to take another commit yet. This overrides force commit, | 136 // be possible to take another commit yet. This overrides force commit, |
137 // as a commit is already still in flight. | 137 // as a commit is already still in flight. |
138 void SetHasPendingTree(bool has_pending_tree); | 138 void SetHasPendingTree(bool has_pending_tree); |
139 bool has_pending_tree() const { return has_pending_tree_; } | 139 bool has_pending_tree() const { return has_pending_tree_; } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 bool draw_if_possible_failed_; | 184 bool draw_if_possible_failed_; |
185 TextureState texture_state_; | 185 TextureState texture_state_; |
186 OutputSurfaceState output_surface_state_; | 186 OutputSurfaceState output_surface_state_; |
187 | 187 |
188 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 188 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
189 }; | 189 }; |
190 | 190 |
191 } // namespace cc | 191 } // namespace cc |
192 | 192 |
193 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 193 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |