Chromium Code Reviews| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 ACTION_SEND_BEGIN_MAIN_FRAME, | 116 ACTION_SEND_BEGIN_MAIN_FRAME, |
| 117 ACTION_COMMIT, | 117 ACTION_COMMIT, |
| 118 ACTION_ACTIVATE_SYNC_TREE, | 118 ACTION_ACTIVATE_SYNC_TREE, |
| 119 ACTION_PERFORM_IMPL_SIDE_INVALIDATION, | 119 ACTION_PERFORM_IMPL_SIDE_INVALIDATION, |
| 120 ACTION_DRAW_IF_POSSIBLE, | 120 ACTION_DRAW_IF_POSSIBLE, |
| 121 ACTION_DRAW_FORCED, | 121 ACTION_DRAW_FORCED, |
| 122 ACTION_DRAW_ABORT, | 122 ACTION_DRAW_ABORT, |
| 123 ACTION_BEGIN_COMPOSITOR_FRAME_SINK_CREATION, | 123 ACTION_BEGIN_COMPOSITOR_FRAME_SINK_CREATION, |
| 124 ACTION_PREPARE_TILES, | 124 ACTION_PREPARE_TILES, |
| 125 ACTION_INVALIDATE_COMPOSITOR_FRAME_SINK, | 125 ACTION_INVALIDATE_COMPOSITOR_FRAME_SINK, |
| 126 ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_SENT, | |
| 126 }; | 127 }; |
| 127 static const char* ActionToString(Action action); | 128 static const char* ActionToString(Action action); |
| 128 | 129 |
| 129 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; | 130 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; |
| 130 void AsValueInto(base::trace_event::TracedValue* dict) const; | 131 void AsValueInto(base::trace_event::TracedValue* dict) const; |
| 131 | 132 |
| 132 Action NextAction() const; | 133 Action NextAction() const; |
| 133 void WillSendBeginMainFrame(); | 134 void WillSendBeginMainFrame(); |
| 135 void WillNotifyBeginMainFrameNotSent(); | |
| 134 void WillCommit(bool commit_had_no_updates); | 136 void WillCommit(bool commit_had_no_updates); |
| 135 void WillActivate(); | 137 void WillActivate(); |
| 136 void WillDraw(); | 138 void WillDraw(); |
| 137 void WillBeginCompositorFrameSinkCreation(); | 139 void WillBeginCompositorFrameSinkCreation(); |
| 138 void WillPrepareTiles(); | 140 void WillPrepareTiles(); |
| 139 void WillInvalidateCompositorFrameSink(); | 141 void WillInvalidateCompositorFrameSink(); |
| 140 void WillPerformImplSideInvalidation(); | 142 void WillPerformImplSideInvalidation(); |
| 141 | 143 |
| 142 void DidDraw(DrawResult draw_result); | 144 void DidDraw(DrawResult draw_result); |
| 143 | 145 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 // TODO(sunnyps): Rename this to ShouldAbortCurrentFrame or similar. | 313 // TODO(sunnyps): Rename this to ShouldAbortCurrentFrame or similar. |
| 312 bool PendingActivationsShouldBeForced() const; | 314 bool PendingActivationsShouldBeForced() const; |
| 313 | 315 |
| 314 bool ShouldBeginCompositorFrameSinkCreation() const; | 316 bool ShouldBeginCompositorFrameSinkCreation() const; |
| 315 bool ShouldDraw() const; | 317 bool ShouldDraw() const; |
| 316 bool ShouldActivatePendingTree() const; | 318 bool ShouldActivatePendingTree() const; |
| 317 bool ShouldSendBeginMainFrame() const; | 319 bool ShouldSendBeginMainFrame() const; |
| 318 bool ShouldCommit() const; | 320 bool ShouldCommit() const; |
| 319 bool ShouldPrepareTiles() const; | 321 bool ShouldPrepareTiles() const; |
| 320 bool ShouldInvalidateCompositorFrameSink() const; | 322 bool ShouldInvalidateCompositorFrameSink() const; |
| 323 bool ShouldNotifyBeginMainFrameNotSent() const; | |
| 321 | 324 |
| 322 void WillDrawInternal(); | 325 void WillDrawInternal(); |
| 323 void WillPerformImplSideInvalidationInternal(); | 326 void WillPerformImplSideInvalidationInternal(); |
| 324 void DidDrawInternal(DrawResult draw_result); | 327 void DidDrawInternal(DrawResult draw_result); |
| 325 | 328 |
| 326 void UpdateBeginFrameSequenceNumbersForBeginFrame(uint32_t source_id, | 329 void UpdateBeginFrameSequenceNumbersForBeginFrame(uint32_t source_id, |
| 327 uint64_t sequence_number); | 330 uint64_t sequence_number); |
| 328 void UpdateBeginFrameSequenceNumbersForBeginFrameDeadline(); | 331 void UpdateBeginFrameSequenceNumbersForBeginFrameDeadline(); |
| 329 | 332 |
| 330 const SchedulerSettings settings_; | 333 const SchedulerSettings settings_; |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 349 int commit_count_; | 352 int commit_count_; |
| 350 int current_frame_number_; | 353 int current_frame_number_; |
| 351 int last_frame_number_submit_performed_; | 354 int last_frame_number_submit_performed_; |
| 352 int last_frame_number_draw_performed_; | 355 int last_frame_number_draw_performed_; |
| 353 int last_frame_number_begin_main_frame_sent_; | 356 int last_frame_number_begin_main_frame_sent_; |
| 354 int last_frame_number_invalidate_compositor_frame_sink_performed_; | 357 int last_frame_number_invalidate_compositor_frame_sink_performed_; |
| 355 | 358 |
| 356 // These are used to ensure that an action only happens once per frame, | 359 // These are used to ensure that an action only happens once per frame, |
| 357 // deadline, etc. | 360 // deadline, etc. |
| 358 bool draw_funnel_; | 361 bool draw_funnel_; |
| 359 bool send_begin_main_frame_funnel_; | 362 bool did_send_begin_main_frame_for_current_frame_; |
|
sunnyps
2017/04/20 18:36:47
Thanks for changing this. I was planning to do the
Dan Elphick
2017/04/26 16:31:44
Acknowledged.
| |
| 360 bool invalidate_compositor_frame_sink_funnel_; | 363 bool invalidate_compositor_frame_sink_funnel_; |
| 361 bool impl_side_invalidation_funnel_; | 364 bool impl_side_invalidation_funnel_; |
| 365 bool did_notify_begin_main_frame_not_sent_; | |
| 366 bool did_commit_during_frame_; | |
| 362 // prepare_tiles_funnel_ is "filled" each time PrepareTiles is called | 367 // prepare_tiles_funnel_ is "filled" each time PrepareTiles is called |
| 363 // and "drained" on each BeginImplFrame. If the funnel gets too full, | 368 // and "drained" on each BeginImplFrame. If the funnel gets too full, |
| 364 // we start throttling ACTION_PREPARE_TILES such that we average one | 369 // we start throttling ACTION_PREPARE_TILES such that we average one |
| 365 // PrepareTiles per BeginImplFrame. | 370 // PrepareTiles per BeginImplFrame. |
| 366 int prepare_tiles_funnel_; | 371 int prepare_tiles_funnel_; |
| 367 | 372 |
| 368 int consecutive_checkerboard_animations_; | 373 int consecutive_checkerboard_animations_; |
| 369 int pending_submit_frames_; | 374 int pending_submit_frames_; |
| 370 int submit_frames_with_current_compositor_frame_sink_; | 375 int submit_frames_with_current_compositor_frame_sink_; |
| 371 bool needs_redraw_; | 376 bool needs_redraw_; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 396 bool previous_pending_tree_was_impl_side_; | 401 bool previous_pending_tree_was_impl_side_; |
| 397 bool current_pending_tree_is_impl_side_; | 402 bool current_pending_tree_is_impl_side_; |
| 398 | 403 |
| 399 private: | 404 private: |
| 400 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 405 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
| 401 }; | 406 }; |
| 402 | 407 |
| 403 } // namespace cc | 408 } // namespace cc |
| 404 | 409 |
| 405 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 410 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| OLD | NEW |