Index: trunk/src/cc/trees/layer_tree_host_impl.cc |
=================================================================== |
--- trunk/src/cc/trees/layer_tree_host_impl.cc (revision 266894) |
+++ trunk/src/cc/trees/layer_tree_host_impl.cc (working copy) |
@@ -470,11 +470,15 @@ |
duration.InSecondsF()); |
} |
- SetNeedsAnimate(); |
+ SetNeedsRedraw(); |
client_->SetNeedsCommitOnImplThread(); |
client_->RenewTreePriority(); |
} |
+void LayerTreeHostImpl::ScheduleAnimation() { |
+ SetNeedsRedraw(); |
+} |
+ |
bool LayerTreeHostImpl::HaveTouchEventHandlersAt( |
const gfx::Point& viewport_point) { |
if (!settings_.touch_hit_testing) |
@@ -1728,11 +1732,6 @@ |
renderer_->SetVisible(visible); |
} |
-void LayerTreeHostImpl::SetNeedsAnimate() { |
- NotifySwapPromiseMonitorsOfSetNeedsRedraw(); |
- client_->SetNeedsAnimateOnImplThread(); |
-} |
- |
void LayerTreeHostImpl::SetNeedsRedraw() { |
NotifySwapPromiseMonitorsOfSetNeedsRedraw(); |
client_->SetNeedsRedrawOnImplThread(); |
@@ -2728,8 +2727,6 @@ |
page_scale_animation_.reset(); |
client_->SetNeedsCommitOnImplThread(); |
client_->RenewTreePriority(); |
- } else { |
- SetNeedsAnimate(); |
} |
} |
@@ -2739,12 +2736,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) { |
@@ -2766,7 +2765,7 @@ |
++iter) |
(*iter).second->Animate(monotonic_time_for_cc_animations); |
- SetNeedsAnimate(); |
+ SetNeedsRedraw(); |
} |
void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) { |
@@ -2788,8 +2787,6 @@ |
if (!events->empty()) { |
client_->PostAnimationEventsToMainThreadOnImplThread(events.Pass()); |
} |
- |
- SetNeedsAnimate(); |
} |
base::TimeDelta LayerTreeHostImpl::LowFrequencyAnimationInterval() const { |
@@ -2863,10 +2860,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) |
@@ -2887,11 +2883,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) |