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

Unified Diff: third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp

Issue 2569913002: Refactor AnimatedStyleBuilder.cpp (Closed)
Patch Set: Finish patch Created 4 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp b/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
index c2b859e203f5d391d5d9b7224d54be87a9ddcc32..6539015eee3bf3ac8f8154898b98abd9a25a539f 100644
--- a/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
@@ -103,14 +103,15 @@ BorderImageLength animatableValueToBorderImageLength(
}
template <typename T>
-T animatableValueClampTo(const AnimatableValue* value,
- T min = defaultMinimumForClamp<T>(),
- T max = defaultMaximumForClamp<T>()) {
+T roundedClampTo(double value) {
static_assert(std::is_integral<T>::value,
"should use integral type T when rounding values");
- return clampTo<T>(
- roundForImpreciseConversion<T>(toAnimatableDouble(value)->toDouble()),
- min, max);
+ return clampTo<T>(roundForImpreciseConversion<T>(value));
+}
+
+template <typename T>
+T animatableValueClampTo(const AnimatableValue* value) {
+ return roundedClampTo<T>(toAnimatableDouble(value)->toDouble());
}
template <typename T>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698