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

Unified Diff: third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp

Issue 2342913003: Replace narrowPrecisionToFloat with clampTo<float> (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp b/third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp
index fc330b63c2be71404e9597f05ef5ef323463e716..bc0af7f46b38a8b0e5227ccc76bbc44c7701a7ce 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp
@@ -33,7 +33,6 @@
#include "core/svg/SVGAnimateElement.h"
#include "core/svg/SVGElement.h"
#include "core/svg/SVGParserUtilities.h"
-#include "platform/FloatConversion.h"
#include "wtf/MathExtras.h"
namespace blink {
@@ -244,12 +243,12 @@ float SVGAnimationElement::getStartTime(ExceptionState& exceptionState) const
exceptionState.throwDOMException(InvalidStateError, "No current interval.");
return 0;
}
- return narrowPrecisionToFloat(startTime.value());
+ return clampTo<float>(startTime.value());
}
float SVGAnimationElement::getCurrentTime() const
{
- return narrowPrecisionToFloat(elapsed().value());
+ return clampTo<float>(elapsed().value());
}
float SVGAnimationElement::getSimpleDuration(ExceptionState& exceptionState) const
@@ -259,7 +258,7 @@ float SVGAnimationElement::getSimpleDuration(ExceptionState& exceptionState) con
exceptionState.throwDOMException(NotSupportedError, "No simple duration defined.");
return 0;
}
- return narrowPrecisionToFloat(duration.value());
+ return clampTo<float>(duration.value());
}
void SVGAnimationElement::beginElement()
@@ -459,7 +458,7 @@ float SVGAnimationElement::calculatePercentForSpline(float percent, unsigned spl
SMILTime duration = simpleDuration();
if (!duration.isFinite())
duration = 100.0;
- return narrowPrecisionToFloat(bezier.SolveWithEpsilon(percent, solveEpsilon(duration.value())));
+ return clampTo<float>(bezier.SolveWithEpsilon(percent, solveEpsilon(duration.value())));
}
float SVGAnimationElement::calculatePercentFromKeyPoints(float percent) const
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGPaintContext.cpp ('k') | third_party/WebKit/Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698