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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

Issue 27200003: Trigger deadline immediately after an aborted main thread commit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check for pending tree. Add test. Created 7 years, 2 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
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler_state_machine.cc
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index 641c80b012510c4162021f89ca68dae99ecec69a..c96e8613944f5f1d3a9776cf5d9ff569be1bd96a 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -881,8 +881,19 @@ bool SchedulerStateMachine::ShouldTriggerBeginFrameDeadlineEarly() const {
return false;
// TODO(brianderson): This should take into account multiple commit sources.
- return begin_frame_state_ == BEGIN_FRAME_STATE_INSIDE_BEGIN_FRAME &&
- active_tree_needs_first_draw_;
+ if (begin_frame_state_ == BEGIN_FRAME_STATE_INSIDE_BEGIN_FRAME &&
+ active_tree_needs_first_draw_)
+ return true;
brianderson 2013/10/15 15:02:32 Sorry, I meant to split this into two conditions:
Sami 2013/10/15 15:12:51 Done.
+
+ // This is used to prioritize impl-thread draws when the main thread isn't
+ // producing anything, e.g., after an aborted commit. We also check that we
+ // don't have a pending tree -- otherwise we should give it a chance to
+ // activate.
+ // TODO(skyostil): Revisit this when we have more accurate deadline estimates.
+ if (commit_state_ == COMMIT_STATE_IDLE && needs_redraw_ && !has_pending_tree_)
+ return true;
+
+ return false;
}
void SchedulerStateMachine::DidEnterPollForAnticipatedDrawTriggers() {
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698