Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1187)

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 615953005: Move page scale animation from LayerTreeHostImpl to LayerTreeImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added CC_EXPORT to PageScaleAnimation Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698