| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2011, 2012. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2011, 2012. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 namespace WebCore { | 27 namespace WebCore { |
| 28 | 28 |
| 29 SVGAnimatedAngleAnimator::SVGAnimatedAngleAnimator(SVGAnimationElement* animatio
nElement, SVGElement* contextElement) | 29 SVGAnimatedAngleAnimator::SVGAnimatedAngleAnimator(SVGAnimationElement* animatio
nElement, SVGElement* contextElement) |
| 30 : SVGAnimatedTypeAnimator(AnimatedAngle, animationElement, contextElement) | 30 : SVGAnimatedTypeAnimator(AnimatedAngle, animationElement, contextElement) |
| 31 { | 31 { |
| 32 } | 32 } |
| 33 | 33 |
| 34 static inline SVGAngle& sharedSVGAngle(const String& valueAsString) | 34 static inline SVGAngle& sharedSVGAngle(const String& valueAsString) |
| 35 { | 35 { |
| 36 DEFINE_STATIC_LOCAL(SVGAngle, sharedAngle, ()); | 36 DEFINE_STATIC_LOCAL(SVGAngle, sharedAngle, ()); |
| 37 sharedAngle.setValueAsString(valueAsString, ASSERT_NO_EXCEPTION_STATE); | 37 sharedAngle.setValueAsString(valueAsString, ASSERT_NO_EXCEPTION); |
| 38 return sharedAngle; | 38 return sharedAngle; |
| 39 } | 39 } |
| 40 | 40 |
| 41 PassOwnPtr<SVGAnimatedType> SVGAnimatedAngleAnimator::constructFromString(const
String& string) | 41 PassOwnPtr<SVGAnimatedType> SVGAnimatedAngleAnimator::constructFromString(const
String& string) |
| 42 { | 42 { |
| 43 OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createAngleAndEnumer
ation(new pair<SVGAngle, unsigned>); | 43 OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createAngleAndEnumer
ation(new pair<SVGAngle, unsigned>); |
| 44 pair<SVGAngle, unsigned>& animatedPair = animatedType->angleAndEnumeration()
; | 44 pair<SVGAngle, unsigned>& animatedPair = animatedType->angleAndEnumeration()
; |
| 45 | 45 |
| 46 SVGAngle angle; | 46 SVGAngle angle; |
| 47 SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>::fro
mString(string, angle); | 47 SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>::fro
mString(string, angle); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 SVGAngle& animatedSVGAngle = animatedAngleAndEnumeration.first; | 143 SVGAngle& animatedSVGAngle = animatedAngleAndEnumeration.first; |
| 144 const SVGAngle& toAtEndOfDurationSVGAngle = toAtEndOfDurationAngleAndEnumera
tion.first; | 144 const SVGAngle& toAtEndOfDurationSVGAngle = toAtEndOfDurationAngleAndEnumera
tion.first; |
| 145 float animatedAngle = animatedSVGAngle.value(); | 145 float animatedAngle = animatedSVGAngle.value(); |
| 146 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromAngle
AndEnumeration.first.value(), toAngleAndEnumeration.first.value(), toAtEndOfDura
tionSVGAngle.value(), animatedAngle); | 146 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromAngle
AndEnumeration.first.value(), toAngleAndEnumeration.first.value(), toAtEndOfDura
tionSVGAngle.value(), animatedAngle); |
| 147 animatedSVGAngle.setValue(animatedAngle); | 147 animatedSVGAngle.setValue(animatedAngle); |
| 148 } | 148 } |
| 149 | 149 |
| 150 float SVGAnimatedAngleAnimator::calculateDistance(const String& fromString, cons
t String& toString) | 150 float SVGAnimatedAngleAnimator::calculateDistance(const String& fromString, cons
t String& toString) |
| 151 { | 151 { |
| 152 SVGAngle from = SVGAngle(); | 152 SVGAngle from = SVGAngle(); |
| 153 from.setValueAsString(fromString, ASSERT_NO_EXCEPTION_STATE); | 153 from.setValueAsString(fromString, ASSERT_NO_EXCEPTION); |
| 154 SVGAngle to = SVGAngle(); | 154 SVGAngle to = SVGAngle(); |
| 155 to.setValueAsString(toString, ASSERT_NO_EXCEPTION_STATE); | 155 to.setValueAsString(toString, ASSERT_NO_EXCEPTION); |
| 156 return fabsf(to.value() - from.value()); | 156 return fabsf(to.value() - from.value()); |
| 157 } | 157 } |
| 158 | 158 |
| 159 } | 159 } |
| OLD | NEW |