| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 | 95 |
| 96 void SVGNumberOptionalNumber::calculateAnimatedValue( | 96 void SVGNumberOptionalNumber::calculateAnimatedValue( |
| 97 SVGAnimationElement* animationElement, | 97 SVGAnimationElement* animationElement, |
| 98 float percentage, | 98 float percentage, |
| 99 unsigned repeatCount, | 99 unsigned repeatCount, |
| 100 SVGPropertyBase* from, | 100 SVGPropertyBase* from, |
| 101 SVGPropertyBase* to, | 101 SVGPropertyBase* to, |
| 102 SVGPropertyBase* toAtEndOfDuration, | 102 SVGPropertyBase* toAtEndOfDuration, |
| 103 SVGElement*) { | 103 SVGElement*) { |
| 104 ASSERT(animationElement); | 104 DCHECK(animationElement); |
| 105 | 105 |
| 106 SVGNumberOptionalNumber* fromNumber = toSVGNumberOptionalNumber(from); | 106 SVGNumberOptionalNumber* fromNumber = toSVGNumberOptionalNumber(from); |
| 107 SVGNumberOptionalNumber* toNumber = toSVGNumberOptionalNumber(to); | 107 SVGNumberOptionalNumber* toNumber = toSVGNumberOptionalNumber(to); |
| 108 SVGNumberOptionalNumber* toAtEndOfDurationNumber = | 108 SVGNumberOptionalNumber* toAtEndOfDurationNumber = |
| 109 toSVGNumberOptionalNumber(toAtEndOfDuration); | 109 toSVGNumberOptionalNumber(toAtEndOfDuration); |
| 110 | 110 |
| 111 float x = m_firstNumber->value(); | 111 float x = m_firstNumber->value(); |
| 112 float y = m_secondNumber->value(); | 112 float y = m_secondNumber->value(); |
| 113 animationElement->animateAdditiveNumber( | 113 animationElement->animateAdditiveNumber( |
| 114 percentage, repeatCount, fromNumber->firstNumber()->value(), | 114 percentage, repeatCount, fromNumber->firstNumber()->value(), |
| 115 toNumber->firstNumber()->value(), | 115 toNumber->firstNumber()->value(), |
| 116 toAtEndOfDurationNumber->firstNumber()->value(), x); | 116 toAtEndOfDurationNumber->firstNumber()->value(), x); |
| 117 animationElement->animateAdditiveNumber( | 117 animationElement->animateAdditiveNumber( |
| 118 percentage, repeatCount, fromNumber->secondNumber()->value(), | 118 percentage, repeatCount, fromNumber->secondNumber()->value(), |
| 119 toNumber->secondNumber()->value(), | 119 toNumber->secondNumber()->value(), |
| 120 toAtEndOfDurationNumber->secondNumber()->value(), y); | 120 toAtEndOfDurationNumber->secondNumber()->value(), y); |
| 121 m_firstNumber->setValue(x); | 121 m_firstNumber->setValue(x); |
| 122 m_secondNumber->setValue(y); | 122 m_secondNumber->setValue(y); |
| 123 } | 123 } |
| 124 | 124 |
| 125 float SVGNumberOptionalNumber::calculateDistance(SVGPropertyBase* other, | 125 float SVGNumberOptionalNumber::calculateDistance(SVGPropertyBase* other, |
| 126 SVGElement*) { | 126 SVGElement*) { |
| 127 // FIXME: Distance calculation is not possible for SVGNumberOptionalNumber | 127 // FIXME: Distance calculation is not possible for SVGNumberOptionalNumber |
| 128 // right now. We need the distance for every single value. | 128 // right now. We need the distance for every single value. |
| 129 return -1; | 129 return -1; |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace blink | 132 } // namespace blink |
| OLD | NEW |