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

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

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/scroll_offset_animation_curve.h" 5 #include "cc/animation/scroll_offset_animation_curve.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 progress, initial_value_.x(), target_value_.x()), 83 progress, initial_value_.x(), target_value_.x()),
84 gfx::Tween::FloatValueBetween( 84 gfx::Tween::FloatValueBetween(
85 progress, initial_value_.y(), target_value_.y())); 85 progress, initial_value_.y(), target_value_.y()));
86 } 86 }
87 87
88 base::TimeDelta ScrollOffsetAnimationCurve::Duration() const { 88 base::TimeDelta ScrollOffsetAnimationCurve::Duration() const {
89 return total_animation_duration_; 89 return total_animation_duration_;
90 } 90 }
91 91
92 AnimationCurve::CurveType ScrollOffsetAnimationCurve::Type() const { 92 AnimationCurve::CurveType ScrollOffsetAnimationCurve::Type() const {
93 return SCROLL_OFFSET; 93 return ScrollOffset;
94 } 94 }
95 95
96 scoped_ptr<AnimationCurve> ScrollOffsetAnimationCurve::Clone() const { 96 scoped_ptr<AnimationCurve> ScrollOffsetAnimationCurve::Clone() const {
97 scoped_ptr<TimingFunction> timing_function( 97 scoped_ptr<TimingFunction> timing_function(
98 static_cast<TimingFunction*>(timing_function_->Clone().release())); 98 static_cast<TimingFunction*>(timing_function_->Clone().release()));
99 scoped_ptr<ScrollOffsetAnimationCurve> curve_clone = 99 scoped_ptr<ScrollOffsetAnimationCurve> curve_clone =
100 Create(target_value_, timing_function.Pass()); 100 Create(target_value_, timing_function.Pass());
101 curve_clone->initial_value_ = initial_value_; 101 curve_clone->initial_value_ = initial_value_;
102 curve_clone->total_animation_duration_ = total_animation_duration_; 102 curve_clone->total_animation_duration_ = total_animation_duration_;
103 curve_clone->last_retarget_ = last_retarget_; 103 curve_clone->last_retarget_ = last_retarget_;
(...skipping 23 matching lines...) Expand all
127 (MaximumDimension(old_delta) / MaximumDimension(new_delta)); 127 (MaximumDimension(old_delta) / MaximumDimension(new_delta));
128 128
129 initial_value_ = current_position; 129 initial_value_ = current_position;
130 target_value_ = new_target; 130 target_value_ = new_target;
131 total_animation_duration_ = base::TimeDelta::FromSecondsD(t + new_duration); 131 total_animation_duration_ = base::TimeDelta::FromSecondsD(t + new_duration);
132 last_retarget_ = base::TimeDelta::FromSecondsD(t); 132 last_retarget_ = base::TimeDelta::FromSecondsD(t);
133 timing_function_ = EaseOutWithInitialVelocity(new_velocity); 133 timing_function_ = EaseOutWithInitialVelocity(new_velocity);
134 } 134 }
135 135
136 } // namespace cc 136 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/layer_animation_controller_unittest.cc ('k') | cc/animation/scroll_offset_animation_curve_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698