OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/blink/web_scroll_offset_animation_curve_impl.h" | 5 #include "cc/blink/web_scroll_offset_animation_curve_impl.h" |
6 | 6 |
7 #include "cc/animation/scroll_offset_animation_curve.h" | 7 #include "cc/animation/scroll_offset_animation_curve.h" |
8 #include "cc/animation/timing_function.h" | 8 #include "cc/animation/timing_function.h" |
9 #include "cc/blink/web_animation_curve_common.h" | 9 #include "cc/blink/web_animation_curve_common.h" |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 WebFloatPoint WebScrollOffsetAnimationCurveImpl::getValue(double time) const { | 36 WebFloatPoint WebScrollOffsetAnimationCurveImpl::getValue(double time) const { |
37 gfx::ScrollOffset value = | 37 gfx::ScrollOffset value = |
38 curve_->GetValue(base::TimeDelta::FromSecondsD(time)); | 38 curve_->GetValue(base::TimeDelta::FromSecondsD(time)); |
39 return WebFloatPoint(value.x(), value.y()); | 39 return WebFloatPoint(value.x(), value.y()); |
40 } | 40 } |
41 | 41 |
42 double WebScrollOffsetAnimationCurveImpl::duration() const { | 42 double WebScrollOffsetAnimationCurveImpl::duration() const { |
43 return curve_->Duration().InSecondsF(); | 43 return curve_->Duration().InSecondsF(); |
44 } | 44 } |
45 | 45 |
| 46 WebFloatPoint WebScrollOffsetAnimationCurveImpl::targetValue() const { |
| 47 gfx::ScrollOffset target = curve_->target_value(); |
| 48 return WebFloatPoint(target.x(), target.y()); |
| 49 } |
| 50 |
| 51 void WebScrollOffsetAnimationCurveImpl::updateTarget(double time, |
| 52 WebFloatPoint new_target) { |
| 53 curve_->UpdateTarget(time, gfx::ScrollOffset(new_target.x, new_target.y)); |
| 54 } |
| 55 |
46 scoped_ptr<cc::AnimationCurve> | 56 scoped_ptr<cc::AnimationCurve> |
47 WebScrollOffsetAnimationCurveImpl::CloneToAnimationCurve() const { | 57 WebScrollOffsetAnimationCurveImpl::CloneToAnimationCurve() const { |
48 return curve_->Clone(); | 58 return curve_->Clone(); |
49 } | 59 } |
50 | 60 |
51 } // namespace cc_blink | 61 } // namespace cc_blink |
OLD | NEW |