| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
| 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 for (unsigned n = 0; n < parseList.size(); ++n) { | 79 for (unsigned n = 0; n < parseList.size(); ++n) { |
| 80 String timeString = parseList[n].stripWhiteSpace(); | 80 String timeString = parseList[n].stripWhiteSpace(); |
| 81 bool ok; | 81 bool ok; |
| 82 float time = timeString.toFloat(&ok); | 82 float time = timeString.toFloat(&ok); |
| 83 if (!ok || time < 0 || time > 1) | 83 if (!ok || time < 0 || time > 1) |
| 84 goto fail; | 84 goto fail; |
| 85 if (verifyOrder) { | 85 if (verifyOrder) { |
| 86 if (!n) { | 86 if (!n) { |
| 87 if (time) | 87 if (time) |
| 88 goto fail; | 88 goto fail; |
| 89 } else if (time < result.last()) { | 89 } else if (time < result.back()) { |
| 90 goto fail; | 90 goto fail; |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 result.append(time); | 93 result.append(time); |
| 94 } | 94 } |
| 95 return true; | 95 return true; |
| 96 fail: | 96 fail: |
| 97 result.clear(); | 97 result.clear(); |
| 98 return false; | 98 return false; |
| 99 } | 99 } |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 m_animationValid = calculateFromAndByValues(from, by); | 561 m_animationValid = calculateFromAndByValues(from, by); |
| 562 } else if (animationMode == ByAnimation) { | 562 } else if (animationMode == ByAnimation) { |
| 563 m_animationValid = calculateFromAndByValues(emptyString(), by); | 563 m_animationValid = calculateFromAndByValues(emptyString(), by); |
| 564 } else if (animationMode == ValuesAnimation) { | 564 } else if (animationMode == ValuesAnimation) { |
| 565 m_animationValid = | 565 m_animationValid = |
| 566 m_values.size() >= 1 && (calcMode == CalcModePaced || | 566 m_values.size() >= 1 && (calcMode == CalcModePaced || |
| 567 !fastHasAttribute(SVGNames::keyTimesAttr) || | 567 !fastHasAttribute(SVGNames::keyTimesAttr) || |
| 568 fastHasAttribute(SVGNames::keyPointsAttr) || | 568 fastHasAttribute(SVGNames::keyPointsAttr) || |
| 569 (m_values.size() == m_keyTimes.size())) && | 569 (m_values.size() == m_keyTimes.size())) && |
| 570 (calcMode == CalcModeDiscrete || !m_keyTimes.size() || | 570 (calcMode == CalcModeDiscrete || !m_keyTimes.size() || |
| 571 m_keyTimes.last() == 1) && | 571 m_keyTimes.back() == 1) && |
| 572 (calcMode != CalcModeSpline || | 572 (calcMode != CalcModeSpline || |
| 573 ((m_keySplines.size() && | 573 ((m_keySplines.size() && |
| 574 (m_keySplines.size() == m_values.size() - 1)) || | 574 (m_keySplines.size() == m_values.size() - 1)) || |
| 575 m_keySplines.size() == m_keyPoints.size() - 1)) && | 575 m_keySplines.size() == m_keyPoints.size() - 1)) && |
| 576 (!fastHasAttribute(SVGNames::keyPointsAttr) || | 576 (!fastHasAttribute(SVGNames::keyPointsAttr) || |
| 577 (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size())); | 577 (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size())); |
| 578 if (m_animationValid) | 578 if (m_animationValid) |
| 579 m_animationValid = calculateToAtEndOfDurationValue(m_values.last()); | 579 m_animationValid = calculateToAtEndOfDurationValue(m_values.back()); |
| 580 if (calcMode == CalcModePaced && m_animationValid) | 580 if (calcMode == CalcModePaced && m_animationValid) |
| 581 calculateKeyTimesForCalcModePaced(); | 581 calculateKeyTimesForCalcModePaced(); |
| 582 } else if (animationMode == PathAnimation) { | 582 } else if (animationMode == PathAnimation) { |
| 583 m_animationValid = | 583 m_animationValid = |
| 584 calcMode == CalcModePaced || | 584 calcMode == CalcModePaced || |
| 585 !fastHasAttribute(SVGNames::keyPointsAttr) || | 585 !fastHasAttribute(SVGNames::keyPointsAttr) || |
| 586 (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size()); | 586 (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size()); |
| 587 } | 587 } |
| 588 | 588 |
| 589 if (m_animationValid && (isAdditive() || isAccumulated())) | 589 if (m_animationValid && (isAdditive() || isAccumulated())) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 618 calculatePercentForSpline(percent, calculateKeyTimesIndex(percent)); | 618 calculatePercentForSpline(percent, calculateKeyTimesIndex(percent)); |
| 619 else if (animationMode == FromToAnimation || animationMode == ToAnimation) | 619 else if (animationMode == FromToAnimation || animationMode == ToAnimation) |
| 620 effectivePercent = calculatePercentForFromTo(percent); | 620 effectivePercent = calculatePercentForFromTo(percent); |
| 621 else | 621 else |
| 622 effectivePercent = percent; | 622 effectivePercent = percent; |
| 623 | 623 |
| 624 calculateAnimatedValue(effectivePercent, repeatCount, resultElement); | 624 calculateAnimatedValue(effectivePercent, repeatCount, resultElement); |
| 625 } | 625 } |
| 626 | 626 |
| 627 } // namespace blink | 627 } // namespace blink |
| OLD | NEW |