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/BasicShapeInterpolationFunctions.h" | 5 #include "core/animation/BasicShapeInterpolationFunctions.h" |
6 | 6 |
7 #include "core/animation/CSSPositionAxisListInterpolationType.h" | 7 #include "core/animation/CSSPositionAxisListInterpolationType.h" |
8 #include "core/animation/LengthInterpolationFunctions.h" | 8 #include "core/animation/LengthInterpolationFunctions.h" |
9 #include "core/css/CSSBasicShapeValues.h" | 9 #include "core/css/CSSBasicShapeValues.h" |
10 #include "core/css/resolver/StyleResolverState.h" | 10 #include "core/css/resolver/StyleResolverState.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 return LengthInterpolationFunctions::createNeutralInterpolableValue(); | 96 return LengthInterpolationFunctions::createNeutralInterpolableValue(); |
97 } | 97 } |
98 | 98 |
99 BasicShapeCenterCoordinate createCoordinate(const InterpolableValue& interpolabl
eValue, const CSSToLengthConversionData& conversionData) | 99 BasicShapeCenterCoordinate createCoordinate(const InterpolableValue& interpolabl
eValue, const CSSToLengthConversionData& conversionData) |
100 { | 100 { |
101 return BasicShapeCenterCoordinate( | 101 return BasicShapeCenterCoordinate( |
102 BasicShapeCenterCoordinate::TopLeft, | 102 BasicShapeCenterCoordinate::TopLeft, |
103 LengthInterpolationFunctions::createLength(interpolableValue, nullptr, c
onversionData, ValueRangeAll)); | 103 LengthInterpolationFunctions::createLength(interpolableValue, nullptr, c
onversionData, ValueRangeAll)); |
104 } | 104 } |
105 | 105 |
106 std::unique_ptr<InterpolableValue> convertCSSRadius(const CSSPrimitiveValue* rad
ius) | 106 std::unique_ptr<InterpolableValue> convertCSSRadius(const CSSValue* radius) |
107 { | 107 { |
108 if (!radius || radius->isValueID()) | 108 if (!radius || radius->isIdentifierValue()) |
109 return nullptr; | 109 return nullptr; |
110 return unwrap(LengthInterpolationFunctions::maybeConvertCSSValue(*radius)); | 110 return unwrap(LengthInterpolationFunctions::maybeConvertCSSValue(*radius)); |
111 } | 111 } |
112 | 112 |
113 std::unique_ptr<InterpolableValue> convertRadius(const BasicShapeRadius& radius,
double zoom) | 113 std::unique_ptr<InterpolableValue> convertRadius(const BasicShapeRadius& radius,
double zoom) |
114 { | 114 { |
115 if (radius.type() != BasicShapeRadius::Value) | 115 if (radius.type() != BasicShapeRadius::Value) |
116 return nullptr; | 116 return nullptr; |
117 return unwrap(LengthInterpolationFunctions::maybeConvertLength(radius.value(
), zoom)); | 117 return unwrap(LengthInterpolationFunctions::maybeConvertLength(radius.value(
), zoom)); |
118 } | 118 } |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 return InsetFunctions::createBasicShape(interpolableValue, conversionDat
a); | 489 return InsetFunctions::createBasicShape(interpolableValue, conversionDat
a); |
490 case BasicShape::BasicShapePolygonType: | 490 case BasicShape::BasicShapePolygonType: |
491 return PolygonFunctions::createBasicShape(interpolableValue, nonInterpol
ableValue, conversionData); | 491 return PolygonFunctions::createBasicShape(interpolableValue, nonInterpol
ableValue, conversionData); |
492 default: | 492 default: |
493 NOTREACHED(); | 493 NOTREACHED(); |
494 return nullptr; | 494 return nullptr; |
495 } | 495 } |
496 } | 496 } |
497 | 497 |
498 } // namespace blink | 498 } // namespace blink |
OLD | NEW |