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

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: Implement value cache function Created 5 years, 11 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 | Source/core/animation/Keyframe.h » ('j') | Source/core/animation/Keyframe.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/DoubleStyleInterpolation.cpp
diff --git a/Source/core/animation/DoubleStyleInterpolation.cpp b/Source/core/animation/DoubleStyleInterpolation.cpp
index 86e2286c2996a905875a4aa809d4efe90b5796cd..2d30be747dfb7f3e7f87a724f2f766fb573e9659 100644
--- a/Source/core/animation/DoubleStyleInterpolation.cpp
+++ b/Source/core/animation/DoubleStyleInterpolation.cpp
@@ -32,20 +32,29 @@ PassRefPtrWillBeRawPtr<CSSValue> DoubleStyleInterpolation::interpolableValueToDo
{
ASSERT(value->isNumber());
double doubleValue = toInterpolableNumber(value)->value();
-
switch (clamp) {
- case RangeOpacityFIXME:
- doubleValue = clampTo<float>(doubleValue, 0, nextafterf(1, 0));
+ case RangeAll:
+ // Do nothing
+ break;
+ case RangeFloatFractions:
+ doubleValue = clampTo<float>(doubleValue, 0, nextafter(1, 0));
+ break;
+ case RangeFloor:
+ doubleValue = floor(doubleValue);
+ break;
+ case RangeDoubleFractions:
+ doubleValue = clampTo<double>(doubleValue, 0.000000000000000000000000000000000000000000001);
Eric Willigers 2015/01/28 22:24:44 Consider using clampTo<double>(doubleValue, std:
+ break;
+ case RangeCeiling:
+ doubleValue = clampTo<int>((doubleValue + 0.5), 1);
+ break;
+ case RangeGreaterThanOne:
+ 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 | « no previous file | Source/core/animation/Keyframe.h » ('j') | Source/core/animation/Keyframe.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698