Index: cc/trees/layer_tree_host_impl.cc |
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
index 554b28f0ac5fd944884e5d6426237a87791fd176..36c71cee823e9594244303d25a7fad1048859003 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -470,9 +470,13 @@ |
duration.InSecondsF()); |
} |
- SetNeedsAnimate(); |
+ SetNeedsRedraw(); |
client_->SetNeedsCommitOnImplThread(); |
client_->RenewTreePriority(); |
+} |
+ |
+void LayerTreeHostImpl::ScheduleAnimation() { |
+ SetNeedsRedraw(); |
} |
bool LayerTreeHostImpl::HaveTouchEventHandlersAt( |
@@ -1714,11 +1718,6 @@ |
renderer_->SetVisible(visible); |
} |
-void LayerTreeHostImpl::SetNeedsAnimate() { |
- NotifySwapPromiseMonitorsOfSetNeedsRedraw(); |
- client_->SetNeedsAnimateOnImplThread(); |
-} |
- |
void LayerTreeHostImpl::SetNeedsRedraw() { |
NotifySwapPromiseMonitorsOfSetNeedsRedraw(); |
client_->SetNeedsRedrawOnImplThread(); |
@@ -2714,8 +2713,6 @@ |
page_scale_animation_.reset(); |
client_->SetNeedsCommitOnImplThread(); |
client_->RenewTreePriority(); |
- } else { |
- SetNeedsAnimate(); |
} |
} |
@@ -2725,12 +2722,14 @@ |
gfx::Vector2dF scroll = top_controls_manager_->Animate(time); |
if (active_tree_->TotalScrollOffset().y() == 0.f) |
return; |
- if (!scroll.IsZero()) { |
+ if (scroll.IsZero()) { |
+ // This may happen on the first animation step. Force redraw otherwise |
+ // the animation would stop because of no new frames. |
+ SetNeedsRedraw(); |
+ } else { |
ScrollViewportBy(gfx::ScaleVector2d( |
scroll, 1.f / active_tree_->total_page_scale_factor())); |
- SetNeedsRedraw(); |
- } |
- SetNeedsAnimate(); |
+ } |
} |
void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) { |
@@ -2752,7 +2751,7 @@ |
++iter) |
(*iter).second->Animate(monotonic_time_for_cc_animations); |
- SetNeedsAnimate(); |
+ SetNeedsRedraw(); |
} |
void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) { |
@@ -2774,8 +2773,6 @@ |
if (!events->empty()) { |
client_->PostAnimationEventsToMainThreadOnImplThread(events.Pass()); |
} |
- |
- SetNeedsAnimate(); |
} |
base::TimeDelta LayerTreeHostImpl::LowFrequencyAnimationInterval() const { |
@@ -2849,10 +2846,9 @@ |
layer->scrollbar_animation_controller(); |
if (scrollbar_controller && scrollbar_controller->Animate(time)) { |
TRACE_EVENT_INSTANT0( |
- "cc", |
- "LayerTreeHostImpl::SetNeedsAnimate due to AnimateScrollbars", |
+ "cc", "LayerTreeHostImpl::SetNeedsRedraw due to AnimateScrollbars", |
TRACE_EVENT_SCOPE_THREAD); |
- SetNeedsAnimate(); |
+ SetNeedsRedraw(); |
} |
for (size_t i = 0; i < layer->children().size(); ++i) |
@@ -2873,11 +2869,10 @@ |
layer->scrollbar_animation_controller(); |
if (scrollbar_controller && scrollbar_controller->IsAnimating()) { |
base::TimeDelta delay = scrollbar_controller->DelayBeforeStart(time); |
- if (delay > base::TimeDelta()) { |
+ if (delay > base::TimeDelta()) |
client_->RequestScrollbarAnimationOnImplThread(delay); |
- } else if (scrollbar_controller->Animate(time)) { |
- SetNeedsAnimate(); |
- } |
+ else if (scrollbar_controller->Animate(time)) |
+ SetNeedsRedraw(); |
} |
for (size_t i = 0; i < layer->children().size(); ++i) |