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

Unified Diff: third_party/WebKit/Source/platform/animation/AnimationUtilities.h

Issue 2272303002: Blink Animation: Limit maximum accuracy to avoid hanging for long durations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | ui/gfx/geometry/cubic_bezier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/animation/AnimationUtilities.h
diff --git a/third_party/WebKit/Source/platform/animation/AnimationUtilities.h b/third_party/WebKit/Source/platform/animation/AnimationUtilities.h
index b7e1ca1e755e06406400c83cb682eea2f928c5c9..6cac97c6d766c3f0ab7001601bd7767423ebedd8 100644
--- a/third_party/WebKit/Source/platform/animation/AnimationUtilities.h
+++ b/third_party/WebKit/Source/platform/animation/AnimationUtilities.h
@@ -30,8 +30,10 @@
#include "platform/PlatformExport.h"
#include "platform/geometry/FloatPoint.h"
#include "platform/geometry/IntPoint.h"
+#include "ui/gfx/geometry/cubic_bezier.h"
#include "wtf/MathExtras.h"
+#include <algorithm>
#include <type_traits>
namespace blink {
@@ -77,7 +79,7 @@ inline FloatPoint blend(const FloatPoint& from, const FloatPoint& to, double pro
// Calculates the accuracy for evaluating a timing function for an animation with the specified duration.
inline double accuracyForDuration(double duration)
{
- return 1.0 / (200.0 * duration);
+ return std::max(1.0 / (200.0 * duration), gfx::CubicBezier::GetDefaultEpsilon());
}
} // namespace blink
« no previous file with comments | « no previous file | ui/gfx/geometry/cubic_bezier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698