Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Side by Side Diff: third_party/WebKit/Source/core/animation/CSSFilterListInterpolationType.cpp

Issue 1885353004: Add ComputedStyle constructor and getter to InterpolationEnvironment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_transformInterpolationType
Patch Set: Rebased Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698