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

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: Add BeginMainFrameNotExpectedUntil to content::CompositorImpl for Android. Created 3 years, 7 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
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/scheduler/scheduler_state_machine.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 ACTION_SEND_BEGIN_MAIN_FRAME, 118 ACTION_SEND_BEGIN_MAIN_FRAME,
119 ACTION_COMMIT, 119 ACTION_COMMIT,
120 ACTION_ACTIVATE_SYNC_TREE, 120 ACTION_ACTIVATE_SYNC_TREE,
121 ACTION_PERFORM_IMPL_SIDE_INVALIDATION, 121 ACTION_PERFORM_IMPL_SIDE_INVALIDATION,
122 ACTION_DRAW_IF_POSSIBLE, 122 ACTION_DRAW_IF_POSSIBLE,
123 ACTION_DRAW_FORCED, 123 ACTION_DRAW_FORCED,
124 ACTION_DRAW_ABORT, 124 ACTION_DRAW_ABORT,
125 ACTION_BEGIN_COMPOSITOR_FRAME_SINK_CREATION, 125 ACTION_BEGIN_COMPOSITOR_FRAME_SINK_CREATION,
126 ACTION_PREPARE_TILES, 126 ACTION_PREPARE_TILES,
127 ACTION_INVALIDATE_COMPOSITOR_FRAME_SINK, 127 ACTION_INVALIDATE_COMPOSITOR_FRAME_SINK,
128 ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_SENT,
128 }; 129 };
129 static const char* ActionToString(Action action); 130 static const char* ActionToString(Action action);
130 131
131 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; 132 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const;
132 void AsValueInto(base::trace_event::TracedValue* dict) const; 133 void AsValueInto(base::trace_event::TracedValue* dict) const;
133 134
134 Action NextAction() const; 135 Action NextAction() const;
135 void WillSendBeginMainFrame(); 136 void WillSendBeginMainFrame();
137 void WillNotifyBeginMainFrameNotSent();
136 void WillCommit(bool commit_had_no_updates); 138 void WillCommit(bool commit_had_no_updates);
137 void WillActivate(); 139 void WillActivate();
138 void WillDraw(); 140 void WillDraw();
139 void WillBeginCompositorFrameSinkCreation(); 141 void WillBeginCompositorFrameSinkCreation();
140 void WillPrepareTiles(); 142 void WillPrepareTiles();
141 void WillInvalidateCompositorFrameSink(); 143 void WillInvalidateCompositorFrameSink();
142 void WillPerformImplSideInvalidation(); 144 void WillPerformImplSideInvalidation();
143 145
144 void DidDraw(DrawResult draw_result); 146 void DidDraw(DrawResult draw_result);
145 147
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // TODO(sunnyps): Rename this to ShouldAbortCurrentFrame or similar. 315 // TODO(sunnyps): Rename this to ShouldAbortCurrentFrame or similar.
314 bool PendingActivationsShouldBeForced() const; 316 bool PendingActivationsShouldBeForced() const;
315 317
316 bool ShouldBeginCompositorFrameSinkCreation() const; 318 bool ShouldBeginCompositorFrameSinkCreation() const;
317 bool ShouldDraw() const; 319 bool ShouldDraw() const;
318 bool ShouldActivatePendingTree() const; 320 bool ShouldActivatePendingTree() const;
319 bool ShouldSendBeginMainFrame() const; 321 bool ShouldSendBeginMainFrame() const;
320 bool ShouldCommit() const; 322 bool ShouldCommit() const;
321 bool ShouldPrepareTiles() const; 323 bool ShouldPrepareTiles() const;
322 bool ShouldInvalidateCompositorFrameSink() const; 324 bool ShouldInvalidateCompositorFrameSink() const;
325 bool ShouldNotifyBeginMainFrameNotSent() const;
323 326
324 void WillDrawInternal(); 327 void WillDrawInternal();
325 void WillPerformImplSideInvalidationInternal(); 328 void WillPerformImplSideInvalidationInternal();
326 void DidDrawInternal(DrawResult draw_result); 329 void DidDrawInternal(DrawResult draw_result);
327 330
328 void UpdateBeginFrameSequenceNumbersForBeginFrame(uint32_t source_id, 331 void UpdateBeginFrameSequenceNumbersForBeginFrame(uint32_t source_id,
329 uint64_t sequence_number); 332 uint64_t sequence_number);
330 void UpdateBeginFrameSequenceNumbersForBeginFrameDeadline(); 333 void UpdateBeginFrameSequenceNumbersForBeginFrameDeadline();
331 334
332 const SchedulerSettings settings_; 335 const SchedulerSettings settings_;
(...skipping 23 matching lines...) Expand all
356 int commit_count_ = 0; 359 int commit_count_ = 0;
357 int current_frame_number_ = 0; 360 int current_frame_number_ = 0;
358 int last_frame_number_submit_performed_ = -1; 361 int last_frame_number_submit_performed_ = -1;
359 int last_frame_number_draw_performed_ = -1; 362 int last_frame_number_draw_performed_ = -1;
360 int last_frame_number_begin_main_frame_sent_ = -1; 363 int last_frame_number_begin_main_frame_sent_ = -1;
361 int last_frame_number_invalidate_compositor_frame_sink_performed_ = -1; 364 int last_frame_number_invalidate_compositor_frame_sink_performed_ = -1;
362 365
363 // These are used to ensure that an action only happens once per frame, 366 // These are used to ensure that an action only happens once per frame,
364 // deadline, etc. 367 // deadline, etc.
365 bool did_draw_ = false; 368 bool did_draw_ = false;
369 bool did_send_begin_main_frame_for_current_frame_ = true;
366 // Initialized to true to prevent begin main frame before begin frames have 370 // Initialized to true to prevent begin main frame before begin frames have
367 // started. Reset to true when we stop asking for begin frames. 371 // started. Reset to true when we stop asking for begin frames.
368 bool did_send_begin_main_frame_ = true; 372 bool did_notify_begin_main_frame_not_sent_ = true;
373 bool did_commit_during_frame_ = false;
369 bool did_invalidate_compositor_frame_sink_ = false; 374 bool did_invalidate_compositor_frame_sink_ = false;
370 bool did_perform_impl_side_invalidation_ = false; 375 bool did_perform_impl_side_invalidation_ = false;
371 bool did_prepare_tiles_ = false; 376 bool did_prepare_tiles_ = false;
372 377
373 int consecutive_checkerboard_animations_ = 0; 378 int consecutive_checkerboard_animations_ = 0;
374 int pending_submit_frames_ = 0; 379 int pending_submit_frames_ = 0;
375 int submit_frames_with_current_compositor_frame_sink_ = 0; 380 int submit_frames_with_current_compositor_frame_sink_ = 0;
376 bool needs_redraw_ = false; 381 bool needs_redraw_ = false;
377 bool needs_prepare_tiles_ = false; 382 bool needs_prepare_tiles_ = false;
378 bool needs_begin_main_frame_ = false; 383 bool needs_begin_main_frame_ = false;
(...skipping 23 matching lines...) Expand all
402 bool previous_pending_tree_was_impl_side_ = false; 407 bool previous_pending_tree_was_impl_side_ = false;
403 bool current_pending_tree_is_impl_side_ = false; 408 bool current_pending_tree_is_impl_side_ = false;
404 409
405 private: 410 private:
406 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); 411 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine);
407 }; 412 };
408 413
409 } // namespace cc 414 } // namespace cc
410 415
411 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ 416 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/scheduler/scheduler_state_machine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698