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 WillAction(Action action); |
sunnyps
2015/08/01 00:59:14
nit: WillPerformAction?
| |
126 | 126 |
127 // Indicates whether the impl thread needs a BeginImplFrame callback in order | 127 // Indicates whether the impl thread needs a BeginImplFrame callback in order |
128 // to make progress. | 128 // to make progress. |
129 bool BeginFrameNeeded() const; | 129 bool BeginFrameNeeded() const; |
130 | 130 |
131 // Indicates that the system has entered and left a BeginImplFrame callback. | 131 // Indicates that the system has entered and left a BeginImplFrame callback. |
132 // The scheduler will not draw more than once in a given BeginImplFrame | 132 // The scheduler will not draw more than once in a given BeginImplFrame |
133 // callback nor send more than one BeginMainFrame message. | 133 // callback nor send more than one BeginMainFrame message. |
134 void OnBeginImplFrame(); | 134 void OnBeginImplFrame(); |
135 void OnBeginImplFrameDeadlinePending(); | 135 void OnBeginImplFrameDeadlinePending(); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
277 | 277 |
278 bool ShouldAnimate() const; | 278 bool ShouldAnimate() const; |
279 bool ShouldBeginOutputSurfaceCreation() const; | 279 bool ShouldBeginOutputSurfaceCreation() const; |
280 bool ShouldDraw() const; | 280 bool ShouldDraw() const; |
281 bool ShouldActivatePendingTree() const; | 281 bool ShouldActivatePendingTree() const; |
282 bool ShouldSendBeginMainFrame() const; | 282 bool ShouldSendBeginMainFrame() const; |
283 bool ShouldCommit() const; | 283 bool ShouldCommit() const; |
284 bool ShouldPrepareTiles() const; | 284 bool ShouldPrepareTiles() const; |
285 bool ShouldInvalidateOutputSurface() const; | 285 bool ShouldInvalidateOutputSurface() const; |
286 | 286 |
287 void UpdateStateOnAnimate(); | 287 void WillAnimate(); |
288 void UpdateStateOnSendBeginMainFrame(); | 288 void WillSendBeginMainFrame(); |
289 void UpdateStateOnCommit(bool commit_had_no_updates); | 289 void WillCommit(bool commit_had_no_updates); |
290 void UpdateStateOnActivation(); | 290 void WillActivate(); |
291 void UpdateStateOnDraw(bool did_request_swap); | 291 void WillDraw(bool did_request_swap); |
292 void UpdateStateOnBeginOutputSurfaceCreation(); | 292 void WillBeginOutputSurfaceCreation(); |
293 void UpdateStateOnPrepareTiles(); | 293 void WillPrepareTiles(); |
294 void UpdateStateOnInvalidateOutputSurface(); | 294 void WillInvalidateOutputSurface(); |
295 | 295 |
296 const SchedulerSettings settings_; | 296 const SchedulerSettings settings_; |
297 | 297 |
298 OutputSurfaceState output_surface_state_; | 298 OutputSurfaceState output_surface_state_; |
299 BeginImplFrameState begin_impl_frame_state_; | 299 BeginImplFrameState begin_impl_frame_state_; |
300 BeginMainFrameState begin_main_frame_state_; | 300 BeginMainFrameState begin_main_frame_state_; |
301 ForcedRedrawOnTimeoutState forced_redraw_state_; | 301 ForcedRedrawOnTimeoutState forced_redraw_state_; |
302 | 302 |
303 // These are used for tracing only. | 303 // These are used for tracing only. |
304 int commit_count_; | 304 int commit_count_; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 bool did_request_swap_in_last_frame_; | 348 bool did_request_swap_in_last_frame_; |
349 bool did_perform_swap_in_last_draw_; | 349 bool did_perform_swap_in_last_draw_; |
350 | 350 |
351 private: | 351 private: |
352 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 352 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
353 }; | 353 }; |
354 | 354 |
355 } // namespace cc | 355 } // namespace cc |
356 | 356 |
357 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 357 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |