| 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 if (m_keyTimes[index] > percent) | 381 if (m_keyTimes[index] > percent) |
| 382 break; | 382 break; |
| 383 } | 383 } |
| 384 return --index; | 384 return --index; |
| 385 } | 385 } |
| 386 | 386 |
| 387 float SVGAnimationElement::calculatePercentForSpline( | 387 float SVGAnimationElement::calculatePercentForSpline( |
| 388 float percent, | 388 float percent, |
| 389 unsigned splineIndex) const { | 389 unsigned splineIndex) const { |
| 390 ASSERT(getCalcMode() == CalcModeSpline); | 390 ASSERT(getCalcMode() == CalcModeSpline); |
| 391 ASSERT_WITH_SECURITY_IMPLICATION(splineIndex < m_keySplines.size()); | 391 SECURITY_DCHECK(splineIndex < m_keySplines.size()); |
| 392 gfx::CubicBezier bezier = m_keySplines[splineIndex]; | 392 gfx::CubicBezier bezier = m_keySplines[splineIndex]; |
| 393 SMILTime duration = simpleDuration(); | 393 SMILTime duration = simpleDuration(); |
| 394 if (!duration.isFinite()) | 394 if (!duration.isFinite()) |
| 395 duration = 100.0; | 395 duration = 100.0; |
| 396 return clampTo<float>( | 396 return clampTo<float>( |
| 397 bezier.SolveWithEpsilon(percent, solveEpsilon(duration.value()))); | 397 bezier.SolveWithEpsilon(percent, solveEpsilon(duration.value()))); |
| 398 } | 398 } |
| 399 | 399 |
| 400 float SVGAnimationElement::calculatePercentFromKeyPoints(float percent) const { | 400 float SVGAnimationElement::calculatePercentFromKeyPoints(float percent) const { |
| 401 ASSERT(!m_keyPoints.isEmpty()); | 401 ASSERT(!m_keyPoints.isEmpty()); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |