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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

Issue 25494009: cc: Fix disabled vsync state freezing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now with test, and formatted 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_state_machine.h ('k') | cc/trees/layer_tree_host_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 0178ccbc62014b8adbc28e98d01d639f19b593e9..641c80b012510c4162021f89ca68dae99ecec69a 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -751,7 +751,7 @@ bool SchedulerStateMachine::BeginFrameNeededByImplThread() const {
// duplicate frames if our new frame isn't ready in time.
// To poll for state with the synchronous compositor without having to draw,
// we rely on ShouldPollForAnticipatedDrawTriggers instead.
- if (settings_.using_synchronous_renderer_compositor)
+ if (!SupportsProactiveBeginFrame())
return BeginFrameNeededToDrawByImplThread();
return BeginFrameNeededToDrawByImplThread() ||
@@ -762,7 +762,7 @@ bool SchedulerStateMachine::ShouldPollForAnticipatedDrawTriggers() const {
// ShouldPollForAnticipatedDrawTriggers is what we use in place of
// ProactiveBeginFrameWantedByImplThread when we are using the synchronous
// compositor.
- if (settings_.using_synchronous_renderer_compositor) {
+ if (!SupportsProactiveBeginFrame()) {
return !BeginFrameNeededToDrawByImplThread() &&
ProactiveBeginFrameWantedByImplThread();
}
@@ -772,6 +772,14 @@ bool SchedulerStateMachine::ShouldPollForAnticipatedDrawTriggers() const {
return false;
}
+bool SchedulerStateMachine::SupportsProactiveBeginFrame() const {
+ // Both the synchronous compositor and disabled vsync settings
+ // make it undesirable to proactively request begin frames.
+ // If this is true, the scheduler should poll.
+ return !settings_.using_synchronous_renderer_compositor &&
+ settings_.throttle_frame_production;
+}
+
// These are the cases where we definitely (or almost definitely) have a
// new frame to draw and can draw.
bool SchedulerStateMachine::BeginFrameNeededToDrawByImplThread() const {
@@ -812,10 +820,6 @@ bool SchedulerStateMachine::ProactiveBeginFrameWantedByImplThread() const {
if (!HasInitializedOutputSurface())
return false;
- // Do not be proactive if vsync is off.
- if (!settings_.throttle_frame_production)
- return false;
-
// Do not be proactive when invisible.
if (!visible_)
return false;
« no previous file with comments | « cc/scheduler/scheduler_state_machine.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698