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

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: Opacity runs on compositor 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
Index: Source/core/animation/DoubleStyleInterpolation.cpp
diff --git a/Source/core/animation/DoubleStyleInterpolation.cpp b/Source/core/animation/DoubleStyleInterpolation.cpp
index 6f9cfe6434b5c425447218eaa405fa4719ba4b4e..1583b7772394b8d8a19784e5d7a172d510a2c0cb 100644
--- a/Source/core/animation/DoubleStyleInterpolation.cpp
+++ b/Source/core/animation/DoubleStyleInterpolation.cpp
@@ -22,8 +22,28 @@ PassRefPtrWillBeRawPtr<CSSValue> DoubleStyleInterpolation::interpolableValueToDo
{
ASSERT(value->isNumber());
double doubleValue = toInterpolableNumber(value)->value();
- if (clamp == ClampOpacity) {
- doubleValue = clampTo<float>(doubleValue, 0, nextafterf(1, 0));
+ switch (clamp) {
+ case NoClamp:
+ // Do nothing
+ break;
+ case ClampOpacity:
+ doubleValue = clampTo<float>(doubleValue, 0, nextafter(0.9999, 0));
alancutter (OOO until 2018) 2015/01/19 02:52:30 Why did this change?
jadeg 2015/01/22 22:14:23 Done.
+ break;
+ case ClampInteger:
+ doubleValue = floor(doubleValue);
+ break;
+ case ClampZoom:
+ doubleValue = clampTo<float>(doubleValue, 0.000000000000000000000000000000000000000000001);
alancutter (OOO until 2018) 2015/01/19 02:52:30 nextafterf(0, 1)?
jadeg 2015/01/22 22:14:23 This clamps to zero, not the correct value
+ break;
+ case ClampOrphans:
+ doubleValue = clampTo<int>((doubleValue + 0.5), 1);
+ break;
+ case ClampOne:
+ doubleValue = clampTo<float>(doubleValue, 1);
+ break;
+ case ClampZero:
+ doubleValue = clampTo<float>(doubleValue, 0);
+ break;
}
return CSSPrimitiveValue::create(doubleValue, CSSPrimitiveValue::CSS_NUMBER);
}

Powered by Google App Engine
This is Rietveld 408576698