| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "webkit/renderer/compositor_bindings/web_scroll_offset_animation_curve_
impl.h" | |
| 6 | |
| 7 #if WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED | |
| 8 | |
| 9 #include "cc/animation/scroll_offset_animation_curve.h" | |
| 10 #include "cc/animation/timing_function.h" | |
| 11 #include "webkit/renderer/compositor_bindings/web_animation_curve_common.h" | |
| 12 | |
| 13 using blink::WebFloatPoint; | |
| 14 | |
| 15 namespace webkit { | |
| 16 | |
| 17 WebScrollOffsetAnimationCurveImpl::WebScrollOffsetAnimationCurveImpl( | |
| 18 WebFloatPoint target_value, | |
| 19 TimingFunctionType timing_function) | |
| 20 : curve_(cc::ScrollOffsetAnimationCurve::Create( | |
| 21 gfx::Vector2dF(target_value.x, target_value.y), | |
| 22 CreateTimingFunction(timing_function))) {} | |
| 23 | |
| 24 WebScrollOffsetAnimationCurveImpl::~WebScrollOffsetAnimationCurveImpl() {} | |
| 25 | |
| 26 blink::WebAnimationCurve::AnimationCurveType | |
| 27 WebScrollOffsetAnimationCurveImpl::type() const { | |
| 28 return WebAnimationCurve::AnimationCurveTypeScrollOffset; | |
| 29 } | |
| 30 | |
| 31 void WebScrollOffsetAnimationCurveImpl::setInitialValue( | |
| 32 WebFloatPoint initial_value) { | |
| 33 curve_->SetInitialValue(gfx::Vector2dF(initial_value.x, initial_value.y)); | |
| 34 } | |
| 35 | |
| 36 WebFloatPoint WebScrollOffsetAnimationCurveImpl::getValue(double time) const { | |
| 37 gfx::Vector2dF value = curve_->GetValue(time); | |
| 38 return WebFloatPoint(value.x(), value.y()); | |
| 39 } | |
| 40 | |
| 41 double WebScrollOffsetAnimationCurveImpl::duration() const { | |
| 42 return curve_->Duration(); | |
| 43 } | |
| 44 | |
| 45 scoped_ptr<cc::AnimationCurve> | |
| 46 WebScrollOffsetAnimationCurveImpl::CloneToAnimationCurve() const { | |
| 47 return curve_->Clone(); | |
| 48 } | |
| 49 | |
| 50 } // namespace webkit | |
| 51 | |
| 52 #endif // WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED | |
| OLD | NEW |