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 ab6309b991003081f0d8d45eb5addade425fa620..dd000d6b750f92769bd755b287158562f30e92d7 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -432,48 +432,6 @@ void LayerTreeHostImpl::ManageTiles() { |
client_->DidManageTiles(); |
} |
-void LayerTreeHostImpl::StartPageScaleAnimation( |
- const gfx::Vector2d& target_offset, |
- bool anchor_point, |
- float page_scale, |
- base::TimeDelta duration) { |
- if (!InnerViewportScrollLayer()) |
- return; |
- |
- gfx::ScrollOffset scroll_total = active_tree_->TotalScrollOffset(); |
- gfx::SizeF scaled_scrollable_size = active_tree_->ScrollableSize(); |
- gfx::SizeF viewport_size = |
- active_tree_->InnerViewportContainerLayer()->bounds(); |
- |
- // Easing constants experimentally determined. |
- scoped_ptr<TimingFunction> timing_function = |
- CubicBezierTimingFunction::Create(.8, 0, .3, .9); |
- |
- // TODO(miletus) : Pass in ScrollOffset. |
- page_scale_animation_ = |
- PageScaleAnimation::Create(ScrollOffsetToVector2dF(scroll_total), |
- active_tree_->total_page_scale_factor(), |
- viewport_size, |
- scaled_scrollable_size, |
- timing_function.Pass()); |
- |
- if (anchor_point) { |
- gfx::Vector2dF anchor(target_offset); |
- page_scale_animation_->ZoomWithAnchor(anchor, |
- page_scale, |
- duration.InSecondsF()); |
- } else { |
- gfx::Vector2dF scaled_target_offset = target_offset; |
- page_scale_animation_->ZoomTo(scaled_target_offset, |
- page_scale, |
- duration.InSecondsF()); |
- } |
- |
- SetNeedsAnimate(); |
- client_->SetNeedsCommitOnImplThread(); |
- client_->RenewTreePriority(); |
-} |
- |
bool LayerTreeHostImpl::IsCurrentlyScrollingLayerAt( |
const gfx::Point& viewport_point, |
InputHandler::ScrollInputType type) { |
@@ -1855,6 +1813,13 @@ void LayerTreeHostImpl::ActivateSyncTree() { |
if (time_source_client_adapter_ && time_source_client_adapter_->Active()) |
DCHECK(active_tree_->root_layer()); |
+ |
+ page_scale_animation_ = active_tree_->TakePageScaleAnimation(); |
+ if (page_scale_animation_) { |
+ SetNeedsAnimate(); |
+ client_->SetNeedsCommitOnImplThread(); |
+ client_->RenewTreePriority(); |
+ } |
} |
void LayerTreeHostImpl::SetVisible(bool visible) { |