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

Side by Side Diff: third_party/WebKit/Source/core/animation/ShadowInterpolationFunctions.cpp

Issue 2314453002: Use CSSPrimitiveValue::create in CSSLengthInterpolationType (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/animation/ShadowInterpolationFunctions.h" 5 #include "core/animation/ShadowInterpolationFunctions.h"
6 6
7 #include "core/animation/CSSColorInterpolationType.h" 7 #include "core/animation/CSSColorInterpolationType.h"
8 #include "core/animation/CSSLengthInterpolationType.h" 8 #include "core/animation/CSSLengthInterpolationType.h"
9 #include "core/animation/InterpolationValue.h" 9 #include "core/animation/InterpolationValue.h"
10 #include "core/animation/NonInterpolableValue.h" 10 #include "core/animation/NonInterpolableValue.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 InterpolableList& underlyingInterpolableList = toInterpolableList(*underlyin gInterpolableValue); 132 InterpolableList& underlyingInterpolableList = toInterpolableList(*underlyin gInterpolableValue);
133 const InterpolableList& interpolableList = toInterpolableList(interpolableVa lue); 133 const InterpolableList& interpolableList = toInterpolableList(interpolableVa lue);
134 underlyingInterpolableList.scaleAndAdd(underlyingFraction, interpolableList) ; 134 underlyingInterpolableList.scaleAndAdd(underlyingFraction, interpolableList) ;
135 } 135 }
136 136
137 ShadowData ShadowInterpolationFunctions::createShadowData(const InterpolableValu e& interpolableValue, const NonInterpolableValue* nonInterpolableValue, const St yleResolverState& state) 137 ShadowData ShadowInterpolationFunctions::createShadowData(const InterpolableValu e& interpolableValue, const NonInterpolableValue* nonInterpolableValue, const St yleResolverState& state)
138 { 138 {
139 const InterpolableList& interpolableList = toInterpolableList(interpolableVa lue); 139 const InterpolableList& interpolableList = toInterpolableList(interpolableVa lue);
140 const ShadowNonInterpolableValue& shadowNonInterpolableValue = toShadowNonIn terpolableValue(*nonInterpolableValue); 140 const ShadowNonInterpolableValue& shadowNonInterpolableValue = toShadowNonIn terpolableValue(*nonInterpolableValue);
141 const CSSToLengthConversionData& conversionData = state.cssToLengthConversio nData(); 141 const CSSToLengthConversionData& conversionData = state.cssToLengthConversio nData();
142 Length shadowX = CSSLengthInterpolationType::resolveInterpolableLength(*inte rpolableList.get(ShadowX), nullptr, conversionData); 142 Length shadowX = CSSLengthInterpolationType::createLength(*interpolableList. get(ShadowX), nullptr, conversionData);
143 Length shadowY = CSSLengthInterpolationType::resolveInterpolableLength(*inte rpolableList.get(ShadowY), nullptr, conversionData); 143 Length shadowY = CSSLengthInterpolationType::createLength(*interpolableList. get(ShadowY), nullptr, conversionData);
144 Length shadowBlur = CSSLengthInterpolationType::resolveInterpolableLength(*i nterpolableList.get(ShadowBlur), nullptr, conversionData, ValueRangeNonNegative) ; 144 Length shadowBlur = CSSLengthInterpolationType::createLength(*interpolableLi st.get(ShadowBlur), nullptr, conversionData, ValueRangeNonNegative);
145 Length shadowSpread = CSSLengthInterpolationType::resolveInterpolableLength( *interpolableList.get(ShadowSpread), nullptr, conversionData); 145 Length shadowSpread = CSSLengthInterpolationType::createLength(*interpolable List.get(ShadowSpread), nullptr, conversionData);
146 DCHECK(shadowX.isFixed() && shadowY.isFixed() && shadowBlur.isFixed() && sha dowSpread.isFixed()); 146 DCHECK(shadowX.isFixed() && shadowY.isFixed() && shadowBlur.isFixed() && sha dowSpread.isFixed());
147 return ShadowData( 147 return ShadowData(
148 FloatPoint(shadowX.value(), shadowY.value()), shadowBlur.value(), shadow Spread.value(), shadowNonInterpolableValue.style(), 148 FloatPoint(shadowX.value(), shadowY.value()), shadowBlur.value(), shadow Spread.value(), shadowNonInterpolableValue.style(),
149 CSSColorInterpolationType::resolveInterpolableColor(*interpolableList.ge t(ShadowColor), state)); 149 CSSColorInterpolationType::resolveInterpolableColor(*interpolableList.ge t(ShadowColor), state));
150 } 150 }
151 151
152 } // namespace blink 152 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698