OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/CSSImageListInterpolationType.h" | 5 #include "core/animation/CSSImageListInterpolationType.h" |
6 | 6 |
7 #include "core/animation/CSSImageInterpolationType.h" | 7 #include "core/animation/CSSImageInterpolationType.h" |
8 #include "core/animation/ImageListPropertyFunctions.h" | 8 #include "core/animation/ImageListPropertyFunctions.h" |
9 #include "core/animation/ListInterpolationFunctions.h" | 9 #include "core/animation/ListInterpolationFunctions.h" |
10 #include "core/css/CSSPrimitiveValue.h" | 10 #include "core/css/CSSPrimitiveValue.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } | 123 } |
124 | 124 |
125 PairwiseInterpolationValue CSSImageListInterpolationType::maybeMergeSingles(Inte
rpolationValue&& start, InterpolationValue&& end) const | 125 PairwiseInterpolationValue CSSImageListInterpolationType::maybeMergeSingles(Inte
rpolationValue&& start, InterpolationValue&& end) const |
126 { | 126 { |
127 return ListInterpolationFunctions::maybeMergeSingles(std::move(start), std::
move(end), CSSImageInterpolationType::staticMergeSingleConversions); | 127 return ListInterpolationFunctions::maybeMergeSingles(std::move(start), std::
move(end), CSSImageInterpolationType::staticMergeSingleConversions); |
128 } | 128 } |
129 | 129 |
130 InterpolationValue CSSImageListInterpolationType::maybeConvertUnderlyingValue(co
nst InterpolationEnvironment& environment) const | 130 InterpolationValue CSSImageListInterpolationType::maybeConvertUnderlyingValue(co
nst InterpolationEnvironment& environment) const |
131 { | 131 { |
132 StyleImageList underlyingImageList; | 132 StyleImageList underlyingImageList; |
133 ImageListPropertyFunctions::getImageList(cssProperty(), *environment.state()
.style(), underlyingImageList); | 133 ImageListPropertyFunctions::getImageList(cssProperty(), environment.style(),
underlyingImageList); |
134 return maybeConvertStyleImageList(underlyingImageList); | 134 return maybeConvertStyleImageList(underlyingImageList); |
135 } | 135 } |
136 | 136 |
137 void CSSImageListInterpolationType::composite(UnderlyingValueOwner& underlyingVa
lueOwner, double underlyingFraction, const InterpolationValue& value, double int
erpolationFraction) const | 137 void CSSImageListInterpolationType::composite(UnderlyingValueOwner& underlyingVa
lueOwner, double underlyingFraction, const InterpolationValue& value, double int
erpolationFraction) const |
138 { | 138 { |
139 underlyingValueOwner.set(*this, value); | 139 underlyingValueOwner.set(*this, value); |
140 } | 140 } |
141 | 141 |
142 void CSSImageListInterpolationType::apply(const InterpolableValue& interpolableV
alue, const NonInterpolableValue* nonInterpolableValue, InterpolationEnvironment
& environment) const | 142 void CSSImageListInterpolationType::apply(const InterpolableValue& interpolableV
alue, const NonInterpolableValue* nonInterpolableValue, InterpolationEnvironment
& environment) const |
143 { | 143 { |
144 const InterpolableList& interpolableList = toInterpolableList(interpolableVa
lue); | 144 const InterpolableList& interpolableList = toInterpolableList(interpolableVa
lue); |
145 const size_t length = interpolableList.length(); | 145 const size_t length = interpolableList.length(); |
146 ASSERT(length > 0); | 146 ASSERT(length > 0); |
147 const NonInterpolableList& nonInterpolableList = toNonInterpolableList(*nonI
nterpolableValue); | 147 const NonInterpolableList& nonInterpolableList = toNonInterpolableList(*nonI
nterpolableValue); |
148 ASSERT(nonInterpolableList.length() == length); | 148 ASSERT(nonInterpolableList.length() == length); |
149 StyleImageList imageList(length); | 149 StyleImageList imageList(length); |
150 for (size_t i = 0; i < length; i++) | 150 for (size_t i = 0; i < length; i++) |
151 imageList[i] = CSSImageInterpolationType::resolveStyleImage(cssProperty(
), *interpolableList.get(i), nonInterpolableList.get(i), environment.state()); | 151 imageList[i] = CSSImageInterpolationType::resolveStyleImage(cssProperty(
), *interpolableList.get(i), nonInterpolableList.get(i), environment.state()); |
152 ImageListPropertyFunctions::setImageList(cssProperty(), *environment.state()
.style(), imageList); | 152 ImageListPropertyFunctions::setImageList(cssProperty(), environment.style(),
imageList); |
153 } | 153 } |
154 | 154 |
155 } // namespace blink | 155 } // namespace blink |
OLD | NEW |