Commit 81699998 authored by alancutter's avatar alancutter Committed by Commit bot

Refactor AnimatedStyleBuilder.cpp

Refactor helper functions for https://codereview.chromium.org/2562643002.

BUG=267316

Review-Url: https://codereview.chromium.org/2569913002
Cr-Commit-Position: refs/heads/master@{#438735}
parent fbcdc87d
......@@ -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>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment