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/CSSTransformInterpolationType.h" | 5 #include "core/animation/CSSTransformInterpolationType.h" |
6 | 6 |
7 #include "core/animation/LengthUnitsChecker.h" | 7 #include "core/animation/LengthUnitsChecker.h" |
8 #include "core/css/CSSFunctionValue.h" | 8 #include "core/css/CSSFunctionValue.h" |
9 #include "core/css/CSSPrimitiveValue.h" | 9 #include "core/css/CSSPrimitiveValue.h" |
10 #include "core/css/CSSValueList.h" | 10 #include "core/css/CSSValueList.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 return PairwiseInterpolationValue( | 188 return PairwiseInterpolationValue( |
189 InterpolableNumber::create(0), | 189 InterpolableNumber::create(0), |
190 InterpolableNumber::create(1), | 190 InterpolableNumber::create(1), |
191 CSSTransformNonInterpolableValue::create( | 191 CSSTransformNonInterpolableValue::create( |
192 std::move(toCSSTransformNonInterpolableValue(*start.nonInterpolableV
alue)), | 192 std::move(toCSSTransformNonInterpolableValue(*start.nonInterpolableV
alue)), |
193 std::move(toCSSTransformNonInterpolableValue(*end.nonInterpolableVal
ue)))); | 193 std::move(toCSSTransformNonInterpolableValue(*end.nonInterpolableVal
ue)))); |
194 } | 194 } |
195 | 195 |
196 InterpolationValue CSSTransformInterpolationType::maybeConvertUnderlyingValue(co
nst InterpolationEnvironment& environment) const | 196 InterpolationValue CSSTransformInterpolationType::maybeConvertUnderlyingValue(co
nst InterpolationEnvironment& environment) const |
197 { | 197 { |
198 return convertTransform(environment.state().style()->transform()); | 198 return convertTransform(environment.style().transform()); |
199 } | 199 } |
200 | 200 |
201 void CSSTransformInterpolationType::composite(UnderlyingValueOwner& underlyingVa
lueOwner, double underlyingFraction, const InterpolationValue& value, double int
erpolationFraction) const | 201 void CSSTransformInterpolationType::composite(UnderlyingValueOwner& underlyingVa
lueOwner, double underlyingFraction, const InterpolationValue& value, double int
erpolationFraction) const |
202 { | 202 { |
203 CSSTransformNonInterpolableValue& underlyingNonInterpolableValue = toCSSTran
sformNonInterpolableValue(*underlyingValueOwner.value().nonInterpolableValue); | 203 CSSTransformNonInterpolableValue& underlyingNonInterpolableValue = toCSSTran
sformNonInterpolableValue(*underlyingValueOwner.value().nonInterpolableValue); |
204 const CSSTransformNonInterpolableValue& nonInterpolableValue = toCSSTransfor
mNonInterpolableValue(*value.nonInterpolableValue); | 204 const CSSTransformNonInterpolableValue& nonInterpolableValue = toCSSTransfor
mNonInterpolableValue(*value.nonInterpolableValue); |
205 double progress = toInterpolableNumber(*value.interpolableValue).value(); | 205 double progress = toInterpolableNumber(*value.interpolableValue).value(); |
206 underlyingValueOwner.mutableValue().nonInterpolableValue = underlyingNonInte
rpolableValue.composite(nonInterpolableValue, progress); | 206 underlyingValueOwner.mutableValue().nonInterpolableValue = underlyingNonInte
rpolableValue.composite(nonInterpolableValue, progress); |
207 } | 207 } |
208 | 208 |
209 void CSSTransformInterpolationType::apply(const InterpolableValue& interpolableV
alue, const NonInterpolableValue* untypedNonInterpolableValue, InterpolationEnvi
ronment& environment) const | 209 void CSSTransformInterpolationType::apply(const InterpolableValue& interpolableV
alue, const NonInterpolableValue* untypedNonInterpolableValue, InterpolationEnvi
ronment& environment) const |
210 { | 210 { |
211 double progress = toInterpolableNumber(interpolableValue).value(); | 211 double progress = toInterpolableNumber(interpolableValue).value(); |
212 const CSSTransformNonInterpolableValue& nonInterpolableValue = toCSSTransfor
mNonInterpolableValue(*untypedNonInterpolableValue); | 212 const CSSTransformNonInterpolableValue& nonInterpolableValue = toCSSTransfor
mNonInterpolableValue(*untypedNonInterpolableValue); |
213 environment.state().style()->setTransform(nonInterpolableValue.getInterpolat
edTransform(progress)); | 213 environment.style().setTransform(nonInterpolableValue.getInterpolatedTransfo
rm(progress)); |
214 } | 214 } |
215 | 215 |
216 } // namespace blink | 216 } // namespace blink |
OLD | NEW |