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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

Issue 14195025: Keep vsync enabled while there is a pending requestAnimationFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scheduler/scheduler_state_machine.h ('k') | cc/trees/thread_proxy.h » ('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 c55631d9122ce770f667bd809b153e5660909447..3af3c41a476b958149fbcfe00ea8a40418137210 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -32,6 +32,7 @@ SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings& settings)
can_draw_(false),
has_pending_tree_(false),
draw_if_possible_failed_(false),
+ animate_requested_(false),
texture_state_(LAYER_TEXTURE_STATE_UNLOCKED),
output_surface_state_(OUTPUT_SURFACE_ACTIVE) {}
@@ -264,6 +265,7 @@ void SchedulerStateMachine::UpdateState(Action action) {
commit_state_ = COMMIT_STATE_FRAME_IN_PROGRESS;
needs_commit_ = false;
needs_forced_commit_ = false;
+ animate_requested_ = false;
return;
case ACTION_COMMIT:
@@ -331,6 +333,9 @@ bool SchedulerStateMachine::VSyncCallbackNeeded() const {
if (has_pending_tree_)
return true;
+ if (animate_requested_)
+ return true;
+
// If we can't draw, don't tick until we are notified that we can draw again.
if (!can_draw_)
return false;
@@ -385,6 +390,10 @@ void SchedulerStateMachine::DidDrawIfPossibleCompleted(bool success) {
void SchedulerStateMachine::SetNeedsCommit() { needs_commit_ = true; }
+void SchedulerStateMachine::SetAnimateRequested() {
+ animate_requested_ = true;
+}
+
void SchedulerStateMachine::SetNeedsForcedCommit() {
needs_forced_commit_ = true;
expect_immediate_begin_frame_ = true;
« no previous file with comments | « cc/scheduler/scheduler_state_machine.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698