Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp

Issue 1819783002: Blink Platform UnitBezier: Implement Slope and Range methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 } 440 }
441 441
442 float SVGAnimationElement::calculatePercentForSpline(float percent, unsigned spl ineIndex) const 442 float SVGAnimationElement::calculatePercentForSpline(float percent, unsigned spl ineIndex) const
443 { 443 {
444 ASSERT(getCalcMode() == CalcModeSpline); 444 ASSERT(getCalcMode() == CalcModeSpline);
445 ASSERT_WITH_SECURITY_IMPLICATION(splineIndex < m_keySplines.size()); 445 ASSERT_WITH_SECURITY_IMPLICATION(splineIndex < m_keySplines.size());
446 UnitBezier bezier = m_keySplines[splineIndex]; 446 UnitBezier bezier = m_keySplines[splineIndex];
447 SMILTime duration = simpleDuration(); 447 SMILTime duration = simpleDuration();
448 if (!duration.isFinite()) 448 if (!duration.isFinite())
449 duration = 100.0; 449 duration = 100.0;
450 return narrowPrecisionToFloat(bezier.solve(percent, solveEpsilon(duration.va lue()))); 450 return narrowPrecisionToFloat(bezier.solveWithEpsilon(percent, solveEpsilon( duration.value())));
451 } 451 }
452 452
453 float SVGAnimationElement::calculatePercentFromKeyPoints(float percent) const 453 float SVGAnimationElement::calculatePercentFromKeyPoints(float percent) const
454 { 454 {
455 ASSERT(!m_keyPoints.isEmpty()); 455 ASSERT(!m_keyPoints.isEmpty());
456 ASSERT(getCalcMode() != CalcModePaced); 456 ASSERT(getCalcMode() != CalcModePaced);
457 ASSERT(m_keyTimes.size() > 1); 457 ASSERT(m_keyTimes.size() > 1);
458 ASSERT(m_keyPoints.size() == m_keyTimes.size()); 458 ASSERT(m_keyPoints.size() == m_keyTimes.size());
459 459
460 if (percent == 1) 460 if (percent == 1)
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 if (!hasInvalidCSSAttributeType) 724 if (!hasInvalidCSSAttributeType)
725 schedule(); 725 schedule();
726 } 726 }
727 727
728 // Clear values that may depend on the previous target. 728 // Clear values that may depend on the previous target.
729 if (targetElement()) 729 if (targetElement())
730 clearAnimatedType(); 730 clearAnimatedType();
731 } 731 }
732 732
733 } // namespace blink 733 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698