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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

Issue 2339633003: Reland of cc: Remove frame queuing from the scheduler. (Closed)
Patch Set: expire missed frames in renderer only Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: cc/scheduler/scheduler_state_machine.cc
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index 1f47e6145517b1c7449469d275036a05f056f67a..cc6cf17598b819161031dd53a15aa20a7095128a 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -365,6 +365,9 @@ bool SchedulerStateMachine::ShouldDraw() const {
if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE)
return false;
+ if (wait_for_ready_to_draw_)
+ return false;
+
// Only handle forced redraws due to timeouts on the regular deadline.
if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW)
return true;
@@ -482,6 +485,10 @@ bool SchedulerStateMachine::ShouldCommit() const {
return false;
}
+ // Active tree resources might still be in use until the Display draws.
+ if (settings_.commit_to_active_tree && SwapThrottled())
+ return false;
+
// If we only have an active tree, it is incorrect to replace it
// before we've drawn it.
DCHECK(!settings_.commit_to_active_tree || !active_tree_needs_first_draw_);
@@ -1025,11 +1032,6 @@ void SchedulerStateMachine::NotifyReadyToCommit() {
DCHECK_EQ(begin_main_frame_state_, BEGIN_MAIN_FRAME_STATE_STARTED)
<< AsValue()->ToString();
begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_READY_TO_COMMIT;
- // In commit_to_active_tree mode, commit should happen right after
- // BeginFrame, meaning when this function is called, next action should be
- // commit.
- if (settings_.commit_to_active_tree)
- DCHECK(ShouldCommit());
}
void SchedulerStateMachine::BeginMainFrameAborted(CommitEarlyOutReason reason) {

Powered by Google App Engine
This is Rietveld 408576698