Index: cc/scheduler/scheduler_state_machine.cc |
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc |
index cc1a56499a4a8c0f7eb7d61ea107e17ed19d2b69..147a5a22830bce3a7d96a6956698881a39a15ec4 100644 |
--- a/cc/scheduler/scheduler_state_machine.cc |
+++ b/cc/scheduler/scheduler_state_machine.cc |
@@ -740,20 +740,16 @@ void SchedulerStateMachine::SetDeferCommits(bool defer_commits) { |
// These are the cases where we definitely (or almost definitely) have a |
// new frame to animate and/or draw and can draw. |
bool SchedulerStateMachine::BeginFrameNeededToAnimateOrDraw() const { |
+ // If we are not visible, we don't need BeginFrame messages. |
+ if (!visible_) |
+ return false; |
sunnyps
2015/04/07 22:55:04
Better move this to the BeginFrameNeeded method no
brianderson
2015/04/08 01:21:59
+1 to moving the visibility checks to BeginFrameNe
mithro-old
2015/04/08 23:40:50
Done.
|
+ |
// The forced draw respects our normal draw scheduling, so we need to |
// request a BeginImplFrame for it. |
if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW) |
return true; |
- // TODO(mithro): Remove background animation ticking. crbug.com/371747 |
- if (needs_animate_) |
- return true; |
- |
- // Only background tick for animations - not draws, which will never happen. |
- if (!visible_) |
- return false; |
- |
- return needs_redraw_; |
+ return needs_animate_ || needs_redraw_; |
} |
// These are cases where we are very likely to draw soon, but might not |