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

Unified Diff: third_party/WebKit/Source/platform/animation/TimingFunction.cpp

Issue 1819783002: Blink Platform UnitBezier: Implement Slope and Range methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address codereview issues. 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/animation/TimingFunction.cpp
diff --git a/third_party/WebKit/Source/platform/animation/TimingFunction.cpp b/third_party/WebKit/Source/platform/animation/TimingFunction.cpp
index 885376ad775a3ce27e69732457c2cd14bee74f52..c7feefb62d2f6f4d703a746f2dca225866286097 100644
--- a/third_party/WebKit/Source/platform/animation/TimingFunction.cpp
+++ b/third_party/WebKit/Source/platform/animation/TimingFunction.cpp
@@ -54,7 +54,7 @@ double CubicBezierTimingFunction::evaluate(double fraction, double accuracy) con
{
if (!m_bezier)
m_bezier = adoptPtr(new UnitBezier(m_x1, m_y1, m_x2, m_y2));
- return m_bezier->solve(fraction, accuracy);
+ return m_bezier->solveWithEpsilon(fraction, accuracy);
}
// This works by taking taking the derivative of the cubic bezier, on the y
@@ -109,8 +109,8 @@ void CubicBezierTimingFunction::range(double* minValue, double* maxValue) const
// Since our input values can be out of the range 0->1 so we must also
// consider the minimum and maximum points.
- double solutionMin = m_bezier->solve(*minValue, std::numeric_limits<double>::epsilon());
- double solutionMax = m_bezier->solve(*maxValue, std::numeric_limits<double>::epsilon());
+ double solutionMin = m_bezier->solveWithEpsilon(*minValue, std::numeric_limits<double>::epsilon());
+ double solutionMax = m_bezier->solveWithEpsilon(*maxValue, std::numeric_limits<double>::epsilon());
*minValue = std::min(std::min(solutionMin, solutionMax), 0.0);
*maxValue = std::max(std::max(solutionMin, solutionMax), 1.0);
*minValue = std::min(std::min(*minValue, solution1), solution2);

Powered by Google App Engine
This is Rietveld 408576698