OLD | NEW |
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/InterpolationValue.h" | 8 #include "core/animation/InterpolationValue.h" |
9 #include "core/animation/LengthInterpolationFunctions.h" | 9 #include "core/animation/LengthInterpolationFunctions.h" |
10 #include "core/animation/NonInterpolableValue.h" | 10 #include "core/animation/NonInterpolableValue.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 CSSColorInterpolationType::createInterpolableColor( | 139 CSSColorInterpolationType::createInterpolableColor( |
140 StyleColor::currentColor())); | 140 StyleColor::currentColor())); |
141 } | 141 } |
142 | 142 |
143 return InterpolationValue(std::move(interpolableList), | 143 return InterpolationValue(std::move(interpolableList), |
144 ShadowNonInterpolableValue::create(style)); | 144 ShadowNonInterpolableValue::create(style)); |
145 } | 145 } |
146 | 146 |
147 std::unique_ptr<InterpolableValue> | 147 std::unique_ptr<InterpolableValue> |
148 ShadowInterpolationFunctions::createNeutralInterpolableValue() { | 148 ShadowInterpolationFunctions::createNeutralInterpolableValue() { |
149 return convertShadowData(ShadowData(FloatPoint(0, 0), 0, 0, Normal, | 149 return convertShadowData(ShadowData::neutralValue(), 1).interpolableValue; |
150 StyleColor(Color::transparent)), | |
151 1) | |
152 .interpolableValue; | |
153 } | 150 } |
154 | 151 |
155 void ShadowInterpolationFunctions::composite( | 152 void ShadowInterpolationFunctions::composite( |
156 std::unique_ptr<InterpolableValue>& underlyingInterpolableValue, | 153 std::unique_ptr<InterpolableValue>& underlyingInterpolableValue, |
157 RefPtr<NonInterpolableValue>& underlyingNonInterpolableValue, | 154 RefPtr<NonInterpolableValue>& underlyingNonInterpolableValue, |
158 double underlyingFraction, | 155 double underlyingFraction, |
159 const InterpolableValue& interpolableValue, | 156 const InterpolableValue& interpolableValue, |
160 const NonInterpolableValue* nonInterpolableValue) { | 157 const NonInterpolableValue* nonInterpolableValue) { |
161 DCHECK(nonInterpolableValuesAreCompatible( | 158 DCHECK(nonInterpolableValuesAreCompatible( |
162 underlyingNonInterpolableValue.get(), nonInterpolableValue)); | 159 underlyingNonInterpolableValue.get(), nonInterpolableValue)); |
(...skipping 27 matching lines...) Expand all Loading... |
190 DCHECK(shadowX.isFixed() && shadowY.isFixed() && shadowBlur.isFixed() && | 187 DCHECK(shadowX.isFixed() && shadowY.isFixed() && shadowBlur.isFixed() && |
191 shadowSpread.isFixed()); | 188 shadowSpread.isFixed()); |
192 return ShadowData(FloatPoint(shadowX.value(), shadowY.value()), | 189 return ShadowData(FloatPoint(shadowX.value(), shadowY.value()), |
193 shadowBlur.value(), shadowSpread.value(), | 190 shadowBlur.value(), shadowSpread.value(), |
194 shadowNonInterpolableValue.style(), | 191 shadowNonInterpolableValue.style(), |
195 CSSColorInterpolationType::resolveInterpolableColor( | 192 CSSColorInterpolationType::resolveInterpolableColor( |
196 *interpolableList.get(ShadowColor), state)); | 193 *interpolableList.get(ShadowColor), state)); |
197 } | 194 } |
198 | 195 |
199 } // namespace blink | 196 } // namespace blink |
OLD | NEW |