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

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

Issue 1164573002: CSSValue Immediates: Change CSSValue to an object instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 5 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 75fee5638af16bfa5af805d1ae924a2f190f654a..38ff7677d8b6bcccd1c7ccc5869c46a6c11197e2 100644
--- a/Source/core/animation/DoubleStyleInterpolation.cpp
+++ b/Source/core/animation/DoubleStyleInterpolation.cpp
@@ -53,7 +53,7 @@ static double clampToRange(double value, InterpolationRange clamp)
}
}
-PassRefPtrWillBeRawPtr<CSSValue> DoubleStyleInterpolation::interpolableValueToDouble(const InterpolableValue* value, bool isNumber, InterpolationRange clamp)
+CSSValue DoubleStyleInterpolation::interpolableValueToDouble(const InterpolableValue* value, bool isNumber, InterpolationRange clamp)
{
ASSERT(value->isNumber());
double doubleValue = clampToRange(toInterpolableNumber(value)->value(), clamp);
@@ -66,11 +66,11 @@ PassRefPtrWillBeRawPtr<CSSValue> DoubleStyleInterpolation::interpolableValueToDo
void DoubleStyleInterpolation::apply(StyleResolverState& state) const
{
if (m_id != CSSPropertyMotionRotation) {
- StyleBuilder::applyProperty(m_id, state, interpolableValueToDouble(m_cachedValue.get(), m_isNumber, m_clamp).get());
+ StyleBuilder::applyProperty(m_id, state, interpolableValueToDouble(m_cachedValue.get(), m_isNumber, m_clamp));
return;
}
- StyleBuilder::applyProperty(m_id, state, interpolableValueToMotionRotation(m_cachedValue.get(), m_flag).get());
+ StyleBuilder::applyProperty(m_id, state, interpolableValueToMotionRotation(m_cachedValue.get(), m_flag));
}
DEFINE_TRACE(DoubleStyleInterpolation)
@@ -84,7 +84,7 @@ PassOwnPtrWillBeRawPtr<InterpolableValue> DoubleStyleInterpolation::toInterpolab
return doubleToInterpolableValue(value);
}
-PassRefPtrWillBeRawPtr<CSSValue> DoubleStyleInterpolation::fromInterpolableValue(const InterpolableValue& value, InterpolationRange range)
+CSSValue DoubleStyleInterpolation::fromInterpolableValue(const InterpolableValue& value, InterpolationRange range)
{
return interpolableValueToDouble(&value, true, range);
}
@@ -102,17 +102,17 @@ bool extractMotionRotation(const CSSValue& value, float* rotation, MotionRotatio
int len = list.length();
for (int i = 0; i < len; i++) {
- const CSSValue* item = list.item(i);
- if (!item->isPrimitiveValue())
+ const CSSValue item = list.item(i);
+ if (!item.isPrimitiveValue())
return false;
- const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
- if (primitiveValue->getValueID() == CSSValueAuto) {
+ const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(item);
+ if (primitiveValue.getValueID() == CSSValueAuto) {
*rotationType = MotionRotationAuto;
- } else if (primitiveValue->getValueID() == CSSValueReverse) {
+ } else if (primitiveValue.getValueID() == CSSValueReverse) {
*rotationType = MotionRotationAuto;
*rotation += 180;
- } else if (primitiveValue->isAngle()) {
- *rotation += primitiveValue->computeDegrees();
+ } else if (primitiveValue.isAngle()) {
+ *rotation += primitiveValue.computeDegrees();
} else {
return false;
}
@@ -122,7 +122,7 @@ bool extractMotionRotation(const CSSValue& value, float* rotation, MotionRotatio
} // namespace
-PassRefPtrWillBeRawPtr<CSSValue> DoubleStyleInterpolation::interpolableValueToMotionRotation(InterpolableValue* value, bool flag)
+CSSValue DoubleStyleInterpolation::interpolableValueToMotionRotation(InterpolableValue* value, bool flag)
{
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
if (flag)
« no previous file with comments | « Source/core/animation/DoubleStyleInterpolation.h ('k') | Source/core/animation/DoubleStyleInterpolationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698