| 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/CSSValueList.h" | 10 #include "core/css/CSSValueList.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 if (!itemResult) | 120 if (!itemResult) |
| 121 return nullptr; | 121 return nullptr; |
| 122 interpolableList->set(i, std::move(itemResult.interpolableValue)); | 122 interpolableList->set(i, std::move(itemResult.interpolableValue)); |
| 123 nonInterpolableValues[i] = itemResult.nonInterpolableValue.release(); | 123 nonInterpolableValues[i] = itemResult.nonInterpolableValue.release(); |
| 124 } | 124 } |
| 125 return InterpolationValue(std::move(interpolableList), NonInterpolableList::
create(std::move(nonInterpolableValues))); | 125 return InterpolationValue(std::move(interpolableList), NonInterpolableList::
create(std::move(nonInterpolableValues))); |
| 126 } | 126 } |
| 127 | 127 |
| 128 InterpolationValue CSSFilterListInterpolationType::maybeConvertUnderlyingValue(c
onst InterpolationEnvironment& environment) const | 128 InterpolationValue CSSFilterListInterpolationType::maybeConvertUnderlyingValue(c
onst InterpolationEnvironment& environment) const |
| 129 { | 129 { |
| 130 const ComputedStyle& style = *environment.state().style(); | 130 const ComputedStyle& style = environment.style(); |
| 131 return convertFilterList(FilterListPropertyFunctions::getFilterList(cssPrope
rty(), style), style.effectiveZoom()); | 131 return convertFilterList(FilterListPropertyFunctions::getFilterList(cssPrope
rty(), style), style.effectiveZoom()); |
| 132 } | 132 } |
| 133 | 133 |
| 134 PairwiseInterpolationValue CSSFilterListInterpolationType::maybeMergeSingles(Int
erpolationValue&& start, InterpolationValue&& end) const | 134 PairwiseInterpolationValue CSSFilterListInterpolationType::maybeMergeSingles(Int
erpolationValue&& start, InterpolationValue&& end) const |
| 135 { | 135 { |
| 136 NonInterpolableList& startNonInterpolableList = toNonInterpolableList(*start
.nonInterpolableValue); | 136 NonInterpolableList& startNonInterpolableList = toNonInterpolableList(*start
.nonInterpolableValue); |
| 137 NonInterpolableList& endNonInterpolableList = toNonInterpolableList(*end.non
InterpolableValue); | 137 NonInterpolableList& endNonInterpolableList = toNonInterpolableList(*end.non
InterpolableValue); |
| 138 size_t startLength = startNonInterpolableList.length(); | 138 size_t startLength = startNonInterpolableList.length(); |
| 139 size_t endLength = endNonInterpolableList.length(); | 139 size_t endLength = endNonInterpolableList.length(); |
| 140 | 140 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 { | 206 { |
| 207 const InterpolableList& interpolableList = toInterpolableList(interpolableVa
lue); | 207 const InterpolableList& interpolableList = toInterpolableList(interpolableVa
lue); |
| 208 const NonInterpolableList& nonInterpolableList = toNonInterpolableList(*nonI
nterpolableValue); | 208 const NonInterpolableList& nonInterpolableList = toNonInterpolableList(*nonI
nterpolableValue); |
| 209 size_t length = interpolableList.length(); | 209 size_t length = interpolableList.length(); |
| 210 ASSERT(length == nonInterpolableList.length()); | 210 ASSERT(length == nonInterpolableList.length()); |
| 211 | 211 |
| 212 FilterOperations filterOperations; | 212 FilterOperations filterOperations; |
| 213 filterOperations.operations().reserveCapacity(length); | 213 filterOperations.operations().reserveCapacity(length); |
| 214 for (size_t i = 0; i < length; i++) | 214 for (size_t i = 0; i < length; i++) |
| 215 filterOperations.operations().append(FilterInterpolationFunctions::creat
eFilter(*interpolableList.get(i), *nonInterpolableList.get(i), environment.state
())); | 215 filterOperations.operations().append(FilterInterpolationFunctions::creat
eFilter(*interpolableList.get(i), *nonInterpolableList.get(i), environment.state
())); |
| 216 FilterListPropertyFunctions::setFilterList(cssProperty(), *environment.state
().style(), std::move(filterOperations)); | 216 FilterListPropertyFunctions::setFilterList(cssProperty(), environment.style(
), std::move(filterOperations)); |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace blink | 219 } // namespace blink |
| OLD | NEW |