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; |