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

Unified Diff: Source/core/animation/DoubleStyleInterpolation.cpp

Issue 811993002: Animation: Implement DoubleStyleInterpolation in StringKeyframe (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove shape image threshold test Created 5 years, 10 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: Source/core/animation/DoubleStyleInterpolation.cpp
diff --git a/Source/core/animation/DoubleStyleInterpolation.cpp b/Source/core/animation/DoubleStyleInterpolation.cpp
index 86e2286c2996a905875a4aa809d4efe90b5796cd..72f68c509051268d441b50e1c44e79c84b205bab 100644
--- a/Source/core/animation/DoubleStyleInterpolation.cpp
+++ b/Source/core/animation/DoubleStyleInterpolation.cpp
@@ -34,18 +34,36 @@ PassRefPtrWillBeRawPtr<CSSValue> DoubleStyleInterpolation::interpolableValueToDo
double doubleValue = toInterpolableNumber(value)->value();
switch (clamp) {
+ case RangeAll:
+ // Do nothing
+ break;
+ case RangeZeroToOne:
+ doubleValue = clampTo<float>(doubleValue, 0, 1);
+ break;
case RangeOpacityFIXME:
- doubleValue = clampTo<float>(doubleValue, 0, nextafterf(1, 0));
+ doubleValue = clampTo<float>(doubleValue, 0, nextafter(1, 0));
+ break;
+ case RangeFloor:
+ doubleValue = floor(doubleValue);
+ break;
+ case RangePositive:
+ doubleValue = clampTo<double>(doubleValue, nextafterf(0, 1));
+ break;
+ case RangeRound:
+ doubleValue = round(doubleValue);
+ break;
+ case RangeRoundGreaterThanOrEqualToOne:
+ doubleValue = clampTo<float>(round(doubleValue), 1);
+ break;
+ case RangeGreaterThanOrEqualToOne:
+ doubleValue = clampTo<float>(doubleValue, 1);
break;
case RangeNonNegative:
doubleValue = clampTo<float>(doubleValue, 0);
break;
- case RangeAll:
- break;
default:
ASSERT_NOT_REACHED();
}
-
if (isNumber)
return CSSPrimitiveValue::create(doubleValue, CSSPrimitiveValue::CSS_NUMBER);
return CSSPrimitiveValue::create(doubleValue, CSSPrimitiveValue::CSS_DEG);
« no previous file with comments | « LayoutTests/animations/interpolation/z-index-interpolation-expected.txt ('k') | Source/core/animation/StringKeyframe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698