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/PathInterpolationFunctions.h" | 5 #include "core/animation/PathInterpolationFunctions.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/animation/InterpolatedSVGPathSource.h" | 8 #include "core/animation/InterpolatedSVGPathSource.h" |
9 #include "core/animation/InterpolationEnvironment.h" | 9 #include "core/animation/InterpolationEnvironment.h" |
10 #include "core/animation/SVGPathSegInterpolationFunctions.h" | 10 #include "core/animation/SVGPathSegInterpolationFunctions.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 Vector<SVGPathSegType> m_pathSegTypes; | 115 Vector<SVGPathSegType> m_pathSegTypes; |
116 }; | 116 }; |
117 | 117 |
118 InterpolationValue PathInterpolationFunctions::maybeConvertNeutral( | 118 InterpolationValue PathInterpolationFunctions::maybeConvertNeutral( |
119 const InterpolationValue& underlying, | 119 const InterpolationValue& underlying, |
120 InterpolationType::ConversionCheckers& conversionCheckers) { | 120 InterpolationType::ConversionCheckers& conversionCheckers) { |
121 conversionCheckers.push_back( | 121 conversionCheckers.push_back( |
122 UnderlyingPathSegTypesChecker::create(underlying)); | 122 UnderlyingPathSegTypesChecker::create(underlying)); |
123 std::unique_ptr<InterpolableList> result = | 123 std::unique_ptr<InterpolableList> result = |
124 InterpolableList::create(PathComponentIndexCount); | 124 InterpolableList::create(PathComponentIndexCount); |
125 result->set(PathArgsIndex, toInterpolableList(*underlying.interpolableValue) | 125 result->set(PathArgsIndex, |
126 .get(PathArgsIndex) | 126 toInterpolableList(*underlying.interpolableValue) |
127 ->cloneAndZero()); | 127 .get(PathArgsIndex) |
| 128 ->cloneAndZero()); |
128 result->set(PathNeutralIndex, InterpolableNumber::create(1)); | 129 result->set(PathNeutralIndex, InterpolableNumber::create(1)); |
129 return InterpolationValue(std::move(result), | 130 return InterpolationValue(std::move(result), |
130 underlying.nonInterpolableValue.get()); | 131 underlying.nonInterpolableValue.get()); |
131 } | 132 } |
132 | 133 |
133 static bool pathSegTypesMatch(const Vector<SVGPathSegType>& a, | 134 static bool pathSegTypesMatch(const Vector<SVGPathSegType>& a, |
134 const Vector<SVGPathSegType>& b) { | 135 const Vector<SVGPathSegType>& b) { |
135 if (a.size() != b.size()) | 136 if (a.size() != b.size()) |
136 return false; | 137 return false; |
137 | 138 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 InterpolatedSVGPathSource source( | 193 InterpolatedSVGPathSource source( |
193 toInterpolableList( | 194 toInterpolableList( |
194 *toInterpolableList(interpolableValue).get(PathArgsIndex)), | 195 *toInterpolableList(interpolableValue).get(PathArgsIndex)), |
195 toSVGPathNonInterpolableValue(nonInterpolableValue)->pathSegTypes()); | 196 toSVGPathNonInterpolableValue(nonInterpolableValue)->pathSegTypes()); |
196 SVGPathByteStreamBuilder builder(*pathByteStream); | 197 SVGPathByteStreamBuilder builder(*pathByteStream); |
197 SVGPathParser::parsePath(source, builder); | 198 SVGPathParser::parsePath(source, builder); |
198 return pathByteStream; | 199 return pathByteStream; |
199 } | 200 } |
200 | 201 |
201 } // namespace blink | 202 } // namespace blink |
OLD | NEW |