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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 ACTION_BEGIN_OUTPUT_SURFACE_CREATION, | 115 ACTION_BEGIN_OUTPUT_SURFACE_CREATION, |
116 ACTION_PREPARE_TILES, | 116 ACTION_PREPARE_TILES, |
117 ACTION_INVALIDATE_OUTPUT_SURFACE, | 117 ACTION_INVALIDATE_OUTPUT_SURFACE, |
118 }; | 118 }; |
119 static const char* ActionToString(Action action); | 119 static const char* ActionToString(Action action); |
120 | 120 |
121 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; | 121 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; |
122 void AsValueInto(base::trace_event::TracedValue* dict) const; | 122 void AsValueInto(base::trace_event::TracedValue* dict) const; |
123 | 123 |
124 Action NextAction() const; | 124 Action NextAction() const; |
125 void UpdateState(Action action); | 125 void WillAnimate(); |
| 126 void WillSendBeginMainFrame(); |
| 127 void WillCommit(bool commit_had_no_updates); |
| 128 void WillActivate(); |
| 129 void WillDraw(bool did_request_swap); |
| 130 void WillBeginOutputSurfaceCreation(); |
| 131 void WillPrepareTiles(); |
| 132 void WillInvalidateOutputSurface(); |
126 | 133 |
127 // Indicates whether the impl thread needs a BeginImplFrame callback in order | 134 // Indicates whether the impl thread needs a BeginImplFrame callback in order |
128 // to make progress. | 135 // to make progress. |
129 bool BeginFrameNeeded() const; | 136 bool BeginFrameNeeded() const; |
130 | 137 |
131 // Indicates that the system has entered and left a BeginImplFrame callback. | 138 // Indicates that the system has entered and left a BeginImplFrame callback. |
132 // The scheduler will not draw more than once in a given BeginImplFrame | 139 // The scheduler will not draw more than once in a given BeginImplFrame |
133 // callback nor send more than one BeginMainFrame message. | 140 // callback nor send more than one BeginMainFrame message. |
134 void OnBeginImplFrame(); | 141 void OnBeginImplFrame(); |
135 void OnBeginImplFrameDeadlinePending(); | 142 void OnBeginImplFrameDeadlinePending(); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 | 284 |
278 bool ShouldAnimate() const; | 285 bool ShouldAnimate() const; |
279 bool ShouldBeginOutputSurfaceCreation() const; | 286 bool ShouldBeginOutputSurfaceCreation() const; |
280 bool ShouldDraw() const; | 287 bool ShouldDraw() const; |
281 bool ShouldActivatePendingTree() const; | 288 bool ShouldActivatePendingTree() const; |
282 bool ShouldSendBeginMainFrame() const; | 289 bool ShouldSendBeginMainFrame() const; |
283 bool ShouldCommit() const; | 290 bool ShouldCommit() const; |
284 bool ShouldPrepareTiles() const; | 291 bool ShouldPrepareTiles() const; |
285 bool ShouldInvalidateOutputSurface() const; | 292 bool ShouldInvalidateOutputSurface() const; |
286 | 293 |
287 void UpdateStateOnAnimate(); | |
288 void UpdateStateOnSendBeginMainFrame(); | |
289 void UpdateStateOnCommit(bool commit_had_no_updates); | |
290 void UpdateStateOnActivation(); | |
291 void UpdateStateOnDraw(bool did_request_swap); | |
292 void UpdateStateOnBeginOutputSurfaceCreation(); | |
293 void UpdateStateOnPrepareTiles(); | |
294 void UpdateStateOnInvalidateOutputSurface(); | |
295 | |
296 const SchedulerSettings settings_; | 294 const SchedulerSettings settings_; |
297 | 295 |
298 OutputSurfaceState output_surface_state_; | 296 OutputSurfaceState output_surface_state_; |
299 BeginImplFrameState begin_impl_frame_state_; | 297 BeginImplFrameState begin_impl_frame_state_; |
300 BeginMainFrameState begin_main_frame_state_; | 298 BeginMainFrameState begin_main_frame_state_; |
301 ForcedRedrawOnTimeoutState forced_redraw_state_; | 299 ForcedRedrawOnTimeoutState forced_redraw_state_; |
302 | 300 |
303 // These are used for tracing only. | 301 // These are used for tracing only. |
304 int commit_count_; | 302 int commit_count_; |
305 int current_frame_number_; | 303 int current_frame_number_; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 bool did_request_swap_in_last_frame_; | 346 bool did_request_swap_in_last_frame_; |
349 bool did_perform_swap_in_last_draw_; | 347 bool did_perform_swap_in_last_draw_; |
350 | 348 |
351 private: | 349 private: |
352 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 350 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
353 }; | 351 }; |
354 | 352 |
355 } // namespace cc | 353 } // namespace cc |
356 | 354 |
357 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 355 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |