| 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 a8001b7da199c0ea05167aef8a253f106578e191..bd406c9c187e805efc5f645e4a9798ee94af23bb 100644
|
| --- a/cc/trees/layer_tree_host_impl.cc
|
| +++ b/cc/trees/layer_tree_host_impl.cc
|
| @@ -471,15 +471,11 @@ void LayerTreeHostImpl::StartPageScaleAnimation(
|
| duration.InSecondsF());
|
| }
|
|
|
| - SetNeedsRedraw();
|
| + SetNeedsAnimate();
|
| client_->SetNeedsCommitOnImplThread();
|
| client_->RenewTreePriority();
|
| }
|
|
|
| -void LayerTreeHostImpl::ScheduleAnimation() {
|
| - SetNeedsRedraw();
|
| -}
|
| -
|
| bool LayerTreeHostImpl::HaveTouchEventHandlersAt(
|
| const gfx::Point& viewport_point) {
|
| if (!settings_.touch_hit_testing)
|
| @@ -1725,6 +1721,10 @@ void LayerTreeHostImpl::SetVisible(bool visible) {
|
| renderer_->SetVisible(visible);
|
| }
|
|
|
| +void LayerTreeHostImpl::SetNeedsAnimate() {
|
| + client_->SetNeedsAnimateOnImplThread();
|
| +}
|
| +
|
| void LayerTreeHostImpl::SetNeedsRedraw() {
|
| NotifySwapPromiseMonitorsOfSetNeedsRedraw();
|
| client_->SetNeedsRedrawOnImplThread();
|
| @@ -2763,6 +2763,8 @@ void LayerTreeHostImpl::AnimatePageScale(base::TimeTicks monotonic_time) {
|
| page_scale_animation_.reset();
|
| client_->SetNeedsCommitOnImplThread();
|
| client_->RenewTreePriority();
|
| + } else {
|
| + SetNeedsAnimate();
|
| }
|
| }
|
|
|
| @@ -2772,14 +2774,12 @@ void LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) {
|
| gfx::Vector2dF scroll = top_controls_manager_->Animate(time);
|
| if (active_tree_->TotalScrollOffset().y() == 0.f)
|
| return;
|
| - 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 {
|
| + if (!scroll.IsZero()) {
|
| ScrollViewportBy(gfx::ScaleVector2d(
|
| scroll, 1.f / active_tree_->total_page_scale_factor()));
|
| + SetNeedsRedraw();
|
| }
|
| + SetNeedsAnimate();
|
| }
|
|
|
| void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) {
|
| @@ -2801,7 +2801,7 @@ void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) {
|
| ++iter)
|
| (*iter).second->Animate(monotonic_time_for_cc_animations);
|
|
|
| - SetNeedsRedraw();
|
| + SetNeedsAnimate();
|
| }
|
|
|
| void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) {
|
| @@ -2911,9 +2911,10 @@ void LayerTreeHostImpl::AnimateScrollbarsRecursive(LayerImpl* layer,
|
| layer->scrollbar_animation_controller();
|
| if (scrollbar_controller && scrollbar_controller->Animate(time)) {
|
| TRACE_EVENT_INSTANT0(
|
| - "cc", "LayerTreeHostImpl::SetNeedsRedraw due to AnimateScrollbars",
|
| + "cc",
|
| + "LayerTreeHostImpl::SetNeedsAnimate due to AnimateScrollbars",
|
| TRACE_EVENT_SCOPE_THREAD);
|
| - SetNeedsRedraw();
|
| + SetNeedsAnimate();
|
| }
|
|
|
| for (size_t i = 0; i < layer->children().size(); ++i)
|
| @@ -2934,10 +2935,11 @@ void LayerTreeHostImpl::StartScrollbarAnimationRecursive(LayerImpl* layer,
|
| 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))
|
| - SetNeedsRedraw();
|
| + } else if (scrollbar_controller->Animate(time)) {
|
| + SetNeedsAnimate();
|
| + }
|
| }
|
|
|
| for (size_t i = 0; i < layer->children().size(); ++i)
|
|
|