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/CSSFilterListInterpolationType.h" | 5 #include "core/animation/CSSFilterListInterpolationType.h" |
6 | 6 |
7 #include "core/animation/FilterInterpolationFunctions.h" | 7 #include "core/animation/FilterInterpolationFunctions.h" |
8 #include "core/animation/FilterListPropertyFunctions.h" | 8 #include "core/animation/FilterListPropertyFunctions.h" |
9 #include "core/animation/ListInterpolationFunctions.h" | 9 #include "core/animation/ListInterpolationFunctions.h" |
10 #include "core/css/CSSIdentifierValue.h" | 10 #include "core/css/CSSIdentifierValue.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 if (!FilterInterpolationFunctions::filtersAreCompatible( | 184 if (!FilterInterpolationFunctions::filtersAreCompatible( |
185 *startNonInterpolableList.get(i), *endNonInterpolableList.get(i))) | 185 *startNonInterpolableList.get(i), *endNonInterpolableList.get(i))) |
186 return nullptr; | 186 return nullptr; |
187 } | 187 } |
188 | 188 |
189 if (startLength == endLength) | 189 if (startLength == endLength) |
190 return PairwiseInterpolationValue(std::move(start.interpolableValue), | 190 return PairwiseInterpolationValue(std::move(start.interpolableValue), |
191 std::move(end.interpolableValue), | 191 std::move(end.interpolableValue), |
192 start.nonInterpolableValue.release()); | 192 start.nonInterpolableValue.release()); |
193 | 193 |
194 // Extend the shorter InterpolableList with neutral values that are compatible
with corresponding filters in the longer list. | 194 // Extend the shorter InterpolableList with neutral values that are compatible |
| 195 // with corresponding filters in the longer list. |
195 InterpolationValue& shorter = startLength < endLength ? start : end; | 196 InterpolationValue& shorter = startLength < endLength ? start : end; |
196 InterpolationValue& longer = startLength < endLength ? end : start; | 197 InterpolationValue& longer = startLength < endLength ? end : start; |
197 size_t shorterLength = | 198 size_t shorterLength = |
198 toNonInterpolableList(*shorter.nonInterpolableValue).length(); | 199 toNonInterpolableList(*shorter.nonInterpolableValue).length(); |
199 size_t longerLength = | 200 size_t longerLength = |
200 toNonInterpolableList(*longer.nonInterpolableValue).length(); | 201 toNonInterpolableList(*longer.nonInterpolableValue).length(); |
201 InterpolableList& shorterInterpolableList = | 202 InterpolableList& shorterInterpolableList = |
202 toInterpolableList(*shorter.interpolableValue); | 203 toInterpolableList(*shorter.interpolableValue); |
203 const NonInterpolableList& longerNonInterpolableList = | 204 const NonInterpolableList& longerNonInterpolableList = |
204 toNonInterpolableList(*longer.nonInterpolableValue); | 205 toNonInterpolableList(*longer.nonInterpolableValue); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 for (size_t i = 0; i < length; i++) | 288 for (size_t i = 0; i < length; i++) |
288 filterOperations.operations().append( | 289 filterOperations.operations().append( |
289 FilterInterpolationFunctions::createFilter(*interpolableList.get(i), | 290 FilterInterpolationFunctions::createFilter(*interpolableList.get(i), |
290 *nonInterpolableList.get(i), | 291 *nonInterpolableList.get(i), |
291 environment.state())); | 292 environment.state())); |
292 FilterListPropertyFunctions::setFilterList( | 293 FilterListPropertyFunctions::setFilterList( |
293 cssProperty(), *environment.state().style(), std::move(filterOperations)); | 294 cssProperty(), *environment.state().style(), std::move(filterOperations)); |
294 } | 295 } |
295 | 296 |
296 } // namespace blink | 297 } // namespace blink |
OLD | NEW |