OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/FilterInterpolationFunctions.h" | 5 #include "core/animation/FilterInterpolationFunctions.h" |
6 | 6 |
7 #include "core/animation/LengthInterpolationFunctions.h" | 7 #include "core/animation/LengthInterpolationFunctions.h" |
8 #include "core/animation/ShadowInterpolationFunctions.h" | 8 #include "core/animation/ShadowInterpolationFunctions.h" |
9 #include "core/css/CSSFunctionValue.h" | 9 #include "core/css/CSSFunctionValue.h" |
10 #include "core/css/CSSPrimitiveValue.h" | 10 #include "core/css/CSSPrimitiveValue.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 result.interpolableValue = InterpolableNumber::create( | 180 result.interpolableValue = InterpolableNumber::create( |
181 toBasicComponentTransferFilterOperation(filter).amount()); | 181 toBasicComponentTransferFilterOperation(filter).amount()); |
182 break; | 182 break; |
183 | 183 |
184 case FilterOperation::BLUR: | 184 case FilterOperation::BLUR: |
185 result = LengthInterpolationFunctions::maybeConvertLength( | 185 result = LengthInterpolationFunctions::maybeConvertLength( |
186 toBlurFilterOperation(filter).stdDeviation(), zoom); | 186 toBlurFilterOperation(filter).stdDeviation(), zoom); |
187 break; | 187 break; |
188 | 188 |
189 case FilterOperation::DROP_SHADOW: { | 189 case FilterOperation::DROP_SHADOW: { |
190 const DropShadowFilterOperation& blurFilter = | 190 result = ShadowInterpolationFunctions::convertShadowData( |
191 toDropShadowFilterOperation(filter); | 191 toDropShadowFilterOperation(filter).shadow(), zoom); |
192 ShadowData shadowData(blurFilter.location(), blurFilter.stdDeviation(), 0, | |
193 Normal, blurFilter.getColor()); | |
194 result = | |
195 ShadowInterpolationFunctions::convertShadowData(shadowData, zoom); | |
196 break; | 192 break; |
197 } | 193 } |
198 | 194 |
199 case FilterOperation::REFERENCE: | 195 case FilterOperation::REFERENCE: |
200 return nullptr; | 196 return nullptr; |
201 | 197 |
202 default: | 198 default: |
203 NOTREACHED(); | 199 NOTREACHED(); |
204 return nullptr; | 200 return nullptr; |
205 } | 201 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 Length stdDeviation = LengthInterpolationFunctions::createLength( | 274 Length stdDeviation = LengthInterpolationFunctions::createLength( |
279 interpolableValue, nonInterpolableValue.typeNonInterpolableValue(), | 275 interpolableValue, nonInterpolableValue.typeNonInterpolableValue(), |
280 state.cssToLengthConversionData(), ValueRangeNonNegative); | 276 state.cssToLengthConversionData(), ValueRangeNonNegative); |
281 return BlurFilterOperation::create(stdDeviation); | 277 return BlurFilterOperation::create(stdDeviation); |
282 } | 278 } |
283 | 279 |
284 case FilterOperation::DROP_SHADOW: { | 280 case FilterOperation::DROP_SHADOW: { |
285 ShadowData shadowData = ShadowInterpolationFunctions::createShadowData( | 281 ShadowData shadowData = ShadowInterpolationFunctions::createShadowData( |
286 interpolableValue, nonInterpolableValue.typeNonInterpolableValue(), | 282 interpolableValue, nonInterpolableValue.typeNonInterpolableValue(), |
287 state); | 283 state); |
288 Color color = shadowData.color().isCurrentColor() | 284 if (shadowData.color().isCurrentColor()) |
289 ? Color::black | 285 shadowData.overrideColor(Color::black); |
290 : shadowData.color().getColor(); | 286 return DropShadowFilterOperation::create(shadowData); |
291 return DropShadowFilterOperation::create( | |
292 IntPoint(shadowData.x(), shadowData.y()), shadowData.blur(), color); | |
293 } | 287 } |
294 | 288 |
295 default: | 289 default: |
296 NOTREACHED(); | 290 NOTREACHED(); |
297 return nullptr; | 291 return nullptr; |
298 } | 292 } |
299 } | 293 } |
300 | 294 |
301 } // namespace blink | 295 } // namespace blink |
OLD | NEW |