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

Unified Diff: cc/animation/animation_player.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/animation/animation_host.cc ('k') | cc/animation/animation_player_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation_player.cc
diff --git a/cc/animation/animation_player.cc b/cc/animation/animation_player.cc
index a5e0e64f2207cb4f4d0bdda128d64107eaae178d..a00e7394219295f9a5d87853f40b589f48d37a70 100644
--- a/cc/animation/animation_player.cc
+++ b/cc/animation/animation_player.cc
@@ -37,7 +37,8 @@ class AnimationPlayer::ValueObserver : public LayerAnimationValueObserver {
}
void OnAnimationWaitingForDeletion() override {
- // TODO(loyso): implement it.
+ // TODO(loyso): See Layer::OnAnimationWaitingForDeletion. But we always do
+ // PushProperties for AnimationTimelines for now.
}
bool IsActive() const override { return is_active_; }
@@ -170,6 +171,8 @@ void AnimationPlayer::LayerUnregistered(int layer_id, bool is_active_tree) {
void AnimationPlayer::AddAnimation(scoped_ptr<Animation> animation) {
DCHECK(layer_animation_controller_);
+ DCHECK(animation->target_property() != Animation::SCROLL_OFFSET ||
+ !animation_host_ || animation_host_->GetSupportsScrollAnimations());
layer_animation_controller_->AddAnimation(animation.Pass());
SetNeedsCommit();
}
@@ -288,7 +291,14 @@ void AnimationPlayer::DestroyPendingValueObserver() {
}
gfx::ScrollOffset AnimationPlayer::ScrollOffsetForAnimation() const {
- // TODO(loyso): implement it.
+ DCHECK(layer_id_);
+ if (animation_host()) {
+ DCHECK(animation_host()->layer_tree_mutators_client());
+ return animation_host()
+ ->layer_tree_mutators_client()
+ ->GetScrollOffsetForAnimation(layer_id_);
+ }
+
return gfx::ScrollOffset();
}
« no previous file with comments | « cc/animation/animation_host.cc ('k') | cc/animation/animation_player_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698