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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1009233002: CC Animations: Port Impl-only-scrolling to use compositor animation timelines. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ui
Patch Set: Add unittests. Created 5 years, 8 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_unittest_animation_timelines.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 db4d26304d5db2e186d6bd0a4c2ab87ec37bbad6..fb7dbffa07d8ec0e708a1b0ded4025525d14c3b3 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3374,6 +3374,10 @@ void LayerTreeHostImpl::ScrollAnimationCreate(
LayerImpl* layer_impl,
const gfx::ScrollOffset& target_offset,
const gfx::ScrollOffset& current_offset) {
+ if (animation_host_)
+ return animation_host_->ImplOnlyScrollAnimationCreate(
+ layer_impl->id(), target_offset, current_offset);
+
scoped_ptr<ScrollOffsetAnimationCurve> curve =
ScrollOffsetAnimationCurve::Create(target_offset,
EaseInOutTimingFunction::Create());
@@ -3390,6 +3394,11 @@ void LayerTreeHostImpl::ScrollAnimationCreate(
bool LayerTreeHostImpl::ScrollAnimationUpdateTarget(
LayerImpl* layer_impl,
const gfx::Vector2dF& scroll_delta) {
+ if (animation_host_)
+ return animation_host_->ImplOnlyScrollAnimationUpdateTarget(
+ layer_impl->id(), scroll_delta, layer_impl->MaxScrollOffset(),
+ CurrentBeginFrameArgs().frame_time);
+
Animation* animation =
layer_impl->layer_animation_controller()
? layer_impl->layer_animation_controller()->GetAnimation(
@@ -3524,4 +3533,19 @@ void LayerTreeHostImpl::SetLayerScrollOffsetMutated(
}
}
+void LayerTreeHostImpl::ScrollOffsetAnimationFinished() {
+ ScrollEnd();
+}
+
+gfx::ScrollOffset LayerTreeHostImpl::GetScrollOffsetForAnimation(
+ int layer_id) const {
+ if (active_tree()) {
+ LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id);
+ if (layer)
+ return layer->ScrollOffsetForAnimation();
+ }
+
+ return gfx::ScrollOffset();
+}
+
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_unittest_animation_timelines.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698