Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: cc/scheduler/scheduler_state_machine.h

Issue 2753843003: Create a new action triggered when a BeginMainFrame is not expected before vsync (Closed)
Patch Set: Respond to Sami's comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_DO_SHORT_IDLE_WORK,
Sami 2017/03/30 15:30:36 ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_SENT
Dan Elphick 2017/04/06 16:10:17 Done.
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 WillDoShortIdleWork();
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
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 ShouldDoShortIdleWork() 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
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_;
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_do_idle_work_;
Sami 2017/03/30 15:30:37 Let's also add a flag saying whether we did a comm
Dan Elphick 2017/04/06 16:10:16 Done.
362 // prepare_tiles_funnel_ is "filled" each time PrepareTiles is called 366 // prepare_tiles_funnel_ is "filled" each time PrepareTiles is called
363 // and "drained" on each BeginImplFrame. If the funnel gets too full, 367 // and "drained" on each BeginImplFrame. If the funnel gets too full,
364 // we start throttling ACTION_PREPARE_TILES such that we average one 368 // we start throttling ACTION_PREPARE_TILES such that we average one
365 // PrepareTiles per BeginImplFrame. 369 // PrepareTiles per BeginImplFrame.
366 int prepare_tiles_funnel_; 370 int prepare_tiles_funnel_;
367 371
368 int consecutive_checkerboard_animations_; 372 int consecutive_checkerboard_animations_;
369 int pending_submit_frames_; 373 int pending_submit_frames_;
370 int submit_frames_with_current_compositor_frame_sink_; 374 int submit_frames_with_current_compositor_frame_sink_;
371 bool needs_redraw_; 375 bool needs_redraw_;
(...skipping 24 matching lines...) Expand all
396 bool previous_pending_tree_was_impl_side_; 400 bool previous_pending_tree_was_impl_side_;
397 bool current_pending_tree_is_impl_side_; 401 bool current_pending_tree_is_impl_side_;
398 402
399 private: 403 private:
400 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); 404 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine);
401 }; 405 };
402 406
403 } // namespace cc 407 } // namespace cc
404 408
405 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ 409 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698