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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 ACTION_CHECK_FOR_COMPLETED_TILE_UPLOADS, | 63 ACTION_CHECK_FOR_COMPLETED_TILE_UPLOADS, |
64 ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED, | 64 ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED, |
65 ACTION_DRAW_IF_POSSIBLE, | 65 ACTION_DRAW_IF_POSSIBLE, |
66 ACTION_DRAW_FORCED, | 66 ACTION_DRAW_FORCED, |
67 ACTION_BEGIN_OUTPUT_SURFACE_CREATION, | 67 ACTION_BEGIN_OUTPUT_SURFACE_CREATION, |
68 ACTION_ACQUIRE_LAYER_TEXTURES_FOR_MAIN_THREAD, | 68 ACTION_ACQUIRE_LAYER_TEXTURES_FOR_MAIN_THREAD, |
69 }; | 69 }; |
70 Action NextAction() const; | 70 Action NextAction() const; |
71 void UpdateState(Action action); | 71 void UpdateState(Action action); |
72 | 72 |
73 // Indicates whether the scheduler needs a vsync callback in order to make | 73 // Indicates whether the scheduler needs a BeginFrame callback in order to |
74 // progress. | 74 // make progress. |
75 bool VSyncCallbackNeeded() const; | 75 bool BeginFrameCallbackNeeded() const; |
76 | 76 |
77 // Indicates that the system has entered and left a vsync callback. | 77 // Indicates that the system has entered and left a BeginFrame callback. |
78 // The scheduler will not draw more than once in a given vsync callback. | 78 // The scheduler will not draw more than once in a given BeginFrame callback. |
79 void DidEnterVSync(); | 79 void DidEnterBeginFrame(); |
80 void DidLeaveVSync(); | 80 void DidLeaveBeginFrame(); |
81 | 81 |
82 // Indicates whether the LayerTreeHostImpl is visible. | 82 // Indicates whether the LayerTreeHostImpl is visible. |
83 void SetVisible(bool visible); | 83 void SetVisible(bool visible); |
84 | 84 |
85 // Indicates that a redraw is required, either due to the impl tree changing | 85 // Indicates that a redraw is required, either due to the impl tree changing |
86 // or the screen being damaged and simply needing redisplay. | 86 // or the screen being damaged and simply needing redisplay. |
87 void SetNeedsRedraw(); | 87 void SetNeedsRedraw(); |
88 | 88 |
89 // As SetNeedsRedraw(), but ensures the draw will definitely happen even if | 89 // As SetNeedsRedraw(), but ensures the draw will definitely happen even if |
90 // we are not visible. | 90 // we are not visible. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 int consecutive_failed_draws_; | 173 int consecutive_failed_draws_; |
174 int maximum_number_of_failed_draws_before_draw_is_forced_; | 174 int maximum_number_of_failed_draws_before_draw_is_forced_; |
175 bool needs_redraw_; | 175 bool needs_redraw_; |
176 bool swap_used_incomplete_tile_; | 176 bool swap_used_incomplete_tile_; |
177 bool needs_forced_redraw_; | 177 bool needs_forced_redraw_; |
178 bool needs_forced_redraw_after_next_commit_; | 178 bool needs_forced_redraw_after_next_commit_; |
179 bool needs_commit_; | 179 bool needs_commit_; |
180 bool needs_forced_commit_; | 180 bool needs_forced_commit_; |
181 bool expect_immediate_begin_frame_; | 181 bool expect_immediate_begin_frame_; |
182 bool main_thread_needs_layer_textures_; | 182 bool main_thread_needs_layer_textures_; |
183 bool inside_vsync_; | 183 bool inside_begin_frame_; |
184 bool visible_; | 184 bool visible_; |
185 bool can_start_; | 185 bool can_start_; |
186 bool can_draw_; | 186 bool can_draw_; |
187 bool has_pending_tree_; | 187 bool has_pending_tree_; |
188 bool draw_if_possible_failed_; | 188 bool draw_if_possible_failed_; |
189 TextureState texture_state_; | 189 TextureState texture_state_; |
190 OutputSurfaceState output_surface_state_; | 190 OutputSurfaceState output_surface_state_; |
191 bool did_create_and_initialize_first_output_surface_; | 191 bool did_create_and_initialize_first_output_surface_; |
192 | 192 |
193 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 193 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
194 }; | 194 }; |
195 | 195 |
196 } // namespace cc | 196 } // namespace cc |
197 | 197 |
198 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 198 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |