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

Side by Side Diff: cc/animation/animation_player.cc

Issue 2971503002: Transform animations should not collapse by default when interpolating (Closed)
Patch Set: . Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « cc/animation/animation_curve.h ('k') | cc/animation/element_animations.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/animation/animation_player.h" 5 #include "cc/animation/animation_player.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "cc/animation/animation_delegate.h" 10 #include "cc/animation/animation_delegate.h"
11 #include "cc/animation/animation_events.h" 11 #include "cc/animation/animation_events.h"
12 #include "cc/animation/animation_host.h" 12 #include "cc/animation/animation_host.h"
13 #include "cc/animation/animation_timeline.h" 13 #include "cc/animation/animation_timeline.h"
14 #include "cc/animation/scroll_offset_animation_curve.h" 14 #include "cc/animation/scroll_offset_animation_curve.h"
15 #include "cc/animation/transform_operations.h"
15 #include "cc/trees/property_animation_state.h" 16 #include "cc/trees/property_animation_state.h"
16 17
17 namespace cc { 18 namespace cc {
18 19
19 scoped_refptr<AnimationPlayer> AnimationPlayer::Create(int id) { 20 scoped_refptr<AnimationPlayer> AnimationPlayer::Create(int id) {
20 return make_scoped_refptr(new AnimationPlayer(id)); 21 return make_scoped_refptr(new AnimationPlayer(id));
21 } 22 }
22 23
23 AnimationPlayer::AnimationPlayer(int id) 24 AnimationPlayer::AnimationPlayer(int id)
24 : animation_host_(), 25 : animation_host_(),
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 if (!animations_[i]->InEffect(monotonic_time)) 733 if (!animations_[i]->InEffect(monotonic_time))
733 continue; 734 continue;
734 735
735 base::TimeDelta trimmed = 736 base::TimeDelta trimmed =
736 animations_[i]->TrimTimeToCurrentIteration(monotonic_time); 737 animations_[i]->TrimTimeToCurrentIteration(monotonic_time);
737 738
738 switch (animations_[i]->target_property()) { 739 switch (animations_[i]->target_property()) {
739 case TargetProperty::TRANSFORM: { 740 case TargetProperty::TRANSFORM: {
740 const TransformAnimationCurve* transform_animation_curve = 741 const TransformAnimationCurve* transform_animation_curve =
741 animations_[i]->curve()->ToTransformAnimationCurve(); 742 animations_[i]->curve()->ToTransformAnimationCurve();
742 const gfx::Transform transform = 743 const TransformOperations operations =
743 transform_animation_curve->GetValue(trimmed); 744 transform_animation_curve->GetValue(trimmed);
744 element_animations_->NotifyClientTransformAnimated( 745 element_animations_->NotifyClientTransformOperationsAnimated(
745 transform, animations_[i]->affects_active_elements(), 746 operations, animations_[i]->affects_active_elements(),
746 animations_[i]->affects_pending_elements()); 747 animations_[i]->affects_pending_elements());
747 break; 748 break;
748 } 749 }
749 750
750 case TargetProperty::OPACITY: { 751 case TargetProperty::OPACITY: {
751 const FloatAnimationCurve* float_animation_curve = 752 const FloatAnimationCurve* float_animation_curve =
752 animations_[i]->curve()->ToFloatAnimationCurve(); 753 animations_[i]->curve()->ToFloatAnimationCurve();
753 const float opacity = std::max( 754 const float opacity = std::max(
754 std::min(float_animation_curve->GetValue(trimmed), 1.0f), 0.f); 755 std::min(float_animation_curve->GetValue(trimmed), 1.0f), 0.f);
755 element_animations_->NotifyClientOpacityAnimated( 756 element_animations_->NotifyClientOpacityAnimated(
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 if (current_impl) 1216 if (current_impl)
1216 animations_[i]->PushPropertiesTo(current_impl); 1217 animations_[i]->PushPropertiesTo(current_impl);
1217 } 1218 }
1218 1219
1219 animation_player_impl->scroll_offset_animation_was_interrupted_ = 1220 animation_player_impl->scroll_offset_animation_was_interrupted_ =
1220 scroll_offset_animation_was_interrupted_; 1221 scroll_offset_animation_was_interrupted_;
1221 scroll_offset_animation_was_interrupted_ = false; 1222 scroll_offset_animation_was_interrupted_ = false;
1222 } 1223 }
1223 1224
1224 } // namespace cc 1225 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/animation_curve.h ('k') | cc/animation/element_animations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698