| OLD | NEW |
| 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 #ifndef AngleSVGInterpolation_h | 5 #ifndef AngleSVGInterpolation_h |
| 6 #define AngleSVGInterpolation_h | 6 #define AngleSVGInterpolation_h |
| 7 | 7 |
| 8 #include "core/animation/SVGInterpolation.h" | 8 #include "core/animation/SVGInterpolation.h" |
| 9 #include "core/svg/SVGAngle.h" | 9 #include "core/svg/SVGAngle.h" |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 { | 28 { |
| 29 return fromInterpolableValue(m_cachedValue.get()); | 29 return fromInterpolableValue(m_cachedValue.get()); |
| 30 } | 30 } |
| 31 | 31 |
| 32 DEFINE_INLINE_VIRTUAL_TRACE() | 32 DEFINE_INLINE_VIRTUAL_TRACE() |
| 33 { | 33 { |
| 34 SVGInterpolation::trace(visitor); | 34 SVGInterpolation::trace(visitor); |
| 35 } | 35 } |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 AngleSVGInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, PassO
wnPtrWillBeRawPtr<InterpolableValue> end, PassRefPtrWillBeRawPtr<SVGAnimatedProp
ertyBase> attribute) | 38 AngleSVGInterpolation(PassOwnPtr<InterpolableValue> start, PassOwnPtr<Interp
olableValue> end, PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase> attribute) |
| 39 : SVGInterpolation(start, end, attribute) | 39 : SVGInterpolation(start, end, attribute) |
| 40 { | 40 { |
| 41 } | 41 } |
| 42 | 42 |
| 43 static PassOwnPtrWillBeRawPtr<InterpolableValue> toInterpolableValue(SVGProp
ertyBase* value) | 43 static PassOwnPtr<InterpolableValue> toInterpolableValue(SVGPropertyBase* va
lue) |
| 44 { | 44 { |
| 45 return InterpolableNumber::create(toSVGAngle(value)->value()); | 45 return InterpolableNumber::create(toSVGAngle(value)->value()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 static PassRefPtrWillBeRawPtr<SVGAngle> fromInterpolableValue(InterpolableVa
lue* value) | 48 static PassRefPtrWillBeRawPtr<SVGAngle> fromInterpolableValue(InterpolableVa
lue* value) |
| 49 { | 49 { |
| 50 double doubleValue = toInterpolableNumber(value)->value(); | 50 double doubleValue = toInterpolableNumber(value)->value(); |
| 51 RefPtrWillBeRawPtr<SVGAngle> result = SVGAngle::create(); | 51 RefPtrWillBeRawPtr<SVGAngle> result = SVGAngle::create(); |
| 52 result->newValueSpecifiedUnits(SVGAngle::SVG_ANGLETYPE_DEG, doubleValue)
; | 52 result->newValueSpecifiedUnits(SVGAngle::SVG_ANGLETYPE_DEG, doubleValue)
; |
| 53 return result.release(); | 53 return result.release(); |
| 54 } | 54 } |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } | 57 } |
| 58 | 58 |
| 59 #endif // AngleSVGInterpolation_h | 59 #endif // AngleSVGInterpolation_h |
| OLD | NEW |