| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 2  * Copyright (C) Research In Motion Limited 2011. 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 71 | 71 | 
| 72     const SVGLengthList& fromLengthList = from->lengthList(); | 72     const SVGLengthList& fromLengthList = from->lengthList(); | 
| 73     SVGLengthList& toLengthList = to->lengthList(); | 73     SVGLengthList& toLengthList = to->lengthList(); | 
| 74 | 74 | 
| 75     unsigned fromLengthListSize = fromLengthList.size(); | 75     unsigned fromLengthListSize = fromLengthList.size(); | 
| 76     if (!fromLengthListSize || fromLengthListSize != toLengthList.size()) | 76     if (!fromLengthListSize || fromLengthListSize != toLengthList.size()) | 
| 77         return; | 77         return; | 
| 78 | 78 | 
| 79     SVGLengthContext lengthContext(m_contextElement); | 79     SVGLengthContext lengthContext(m_contextElement); | 
| 80     for (unsigned i = 0; i < fromLengthListSize; ++i) | 80     for (unsigned i = 0; i < fromLengthListSize; ++i) | 
| 81         toLengthList[i].setValue(toLengthList[i].value(lengthContext) + fromLeng
     thList[i].value(lengthContext), lengthContext, ASSERT_NO_EXCEPTION_STATE); | 81         toLengthList[i].setValue(toLengthList[i].value(lengthContext) + fromLeng
     thList[i].value(lengthContext), lengthContext, ASSERT_NO_EXCEPTION); | 
| 82 } | 82 } | 
| 83 | 83 | 
| 84 static SVGLengthList parseLengthListFromString(SVGAnimationElement* animationEle
     ment, const String& string) | 84 static SVGLengthList parseLengthListFromString(SVGAnimationElement* animationEle
     ment, const String& string) | 
| 85 { | 85 { | 
| 86     SVGLengthList lengthList; | 86     SVGLengthList lengthList; | 
| 87     lengthList.parse(string, SVGLength::lengthModeForAnimatedLengthAttribute(ani
     mationElement->attributeName())); | 87     lengthList.parse(string, SVGLength::lengthModeForAnimatedLengthAttribute(ani
     mationElement->attributeName())); | 
| 88     return lengthList; | 88     return lengthList; | 
| 89 } | 89 } | 
| 90 | 90 | 
| 91 void SVGAnimatedLengthListAnimator::calculateAnimatedValue(float percentage, uns
     igned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* 
     toAtEndOfDuration, SVGAnimatedType* animated) | 91 void SVGAnimatedLengthListAnimator::calculateAnimatedValue(float percentage, uns
     igned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* 
     toAtEndOfDuration, SVGAnimatedType* animated) | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 115         SVGLengthType unitType = toLengthList[i].unitType(); | 115         SVGLengthType unitType = toLengthList[i].unitType(); | 
| 116         float effectiveFrom = 0; | 116         float effectiveFrom = 0; | 
| 117         if (fromLengthListSize) { | 117         if (fromLengthListSize) { | 
| 118             if (percentage < 0.5) | 118             if (percentage < 0.5) | 
| 119                 unitType = fromLengthList[i].unitType(); | 119                 unitType = fromLengthList[i].unitType(); | 
| 120             effectiveFrom = fromLengthList[i].value(lengthContext); | 120             effectiveFrom = fromLengthList[i].value(lengthContext); | 
| 121         } | 121         } | 
| 122         float effectiveToAtEnd = i < toAtEndOfDurationListSize ? toAtEndOfDurati
     onLengthList[i].value(lengthContext) : 0; | 122         float effectiveToAtEnd = i < toAtEndOfDurationListSize ? toAtEndOfDurati
     onLengthList[i].value(lengthContext) : 0; | 
| 123 | 123 | 
| 124         m_animationElement->animateAdditiveNumber(percentage, repeatCount, effec
     tiveFrom, toLengthList[i].value(lengthContext), effectiveToAtEnd, animatedNumber
     ); | 124         m_animationElement->animateAdditiveNumber(percentage, repeatCount, effec
     tiveFrom, toLengthList[i].value(lengthContext), effectiveToAtEnd, animatedNumber
     ); | 
| 125         animatedLengthList[i].setValue(lengthContext, animatedNumber, m_lengthMo
     de, unitType, ASSERT_NO_EXCEPTION_STATE); | 125         animatedLengthList[i].setValue(lengthContext, animatedNumber, m_lengthMo
     de, unitType, ASSERT_NO_EXCEPTION); | 
| 126     } | 126     } | 
| 127 } | 127 } | 
| 128 | 128 | 
| 129 float SVGAnimatedLengthListAnimator::calculateDistance(const String&, const Stri
     ng&) | 129 float SVGAnimatedLengthListAnimator::calculateDistance(const String&, const Stri
     ng&) | 
| 130 { | 130 { | 
| 131     // FIXME: Distance calculation is not possible for SVGLengthList right now. 
     We need the distance for every single value. | 131     // FIXME: Distance calculation is not possible for SVGLengthList right now. 
     We need the distance for every single value. | 
| 132     return -1; | 132     return -1; | 
| 133 } | 133 } | 
| 134 | 134 | 
| 135 } | 135 } | 
| OLD | NEW | 
|---|