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 "config.h" | 5 #include "config.h" |
6 #include "core/animation/InvalidatableStyleInterpolation.h" | 6 #include "core/animation/InvalidatableStyleInterpolation.h" |
7 | 7 |
8 #include "core/animation/StringKeyframe.h" | 8 #include "core/animation/StringKeyframe.h" |
9 #include "core/css/resolver/StyleResolverState.h" | 9 #include "core/css/resolver/StyleResolverState.h" |
10 | 10 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 state.parentStyle()->setHasExplicitlyInheritedProperties(); | 119 state.parentStyle()->setHasExplicitlyInheritedProperties(); |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
123 void InvalidatableStyleInterpolation::apply(StyleResolverState& state) const | 123 void InvalidatableStyleInterpolation::apply(StyleResolverState& state) const |
124 { | 124 { |
125 OwnPtrWillBeRawPtr<InterpolationValue> underlyingValue = dependsOnUnderlying Value() ? maybeConvertUnderlyingValue(state) : nullptr; | 125 OwnPtrWillBeRawPtr<InterpolationValue> underlyingValue = dependsOnUnderlying Value() ? maybeConvertUnderlyingValue(state) : nullptr; |
126 ensureValidInterpolation(state, underlyingValue.get()); | 126 ensureValidInterpolation(state, underlyingValue.get()); |
127 if (!m_cachedValue) | 127 if (!m_cachedValue) |
128 return; | 128 return; |
129 const InterpolableValue* appliedInterpolableValue = &m_cachedValue->interpol ableValue(); | 129 const InterpolationValue* appliedValue = m_cachedValue.get(); |
130 if (underlyingValue && m_cachedValue->type() == underlyingValue->type()) { | 130 if (underlyingValue && m_cachedValue->type() == underlyingValue->type()) { |
131 appliedValue = underlyingValue.get(); | |
131 double underlyingFraction = m_cachedConversion->interpolateUnderlyingFra ction(m_startKeyframe.underlyingFraction(), m_endKeyframe.underlyingFraction(), m_currentFraction); | 132 double underlyingFraction = m_cachedConversion->interpolateUnderlyingFra ction(m_startKeyframe.underlyingFraction(), m_endKeyframe.underlyingFraction(), m_currentFraction); |
132 underlyingValue->interpolableValue().scaleAndAdd(underlyingFraction, m_c achedValue->interpolableValue()); | 133 underlyingValue->interpolableValue().scaleAndAdd(underlyingFraction, m_c achedValue->interpolableValue()); |
133 appliedInterpolableValue = &underlyingValue->interpolableValue(); | 134 underlyingValue->setNonInterpolableValue(m_cachedValue->type().mergeNonI nterpolableValues(underlyingValue->nonInterpolableValue(), m_cachedValue->nonInt erpolableValue())); |
dstockwell
2015/08/31 06:44:26
It seems odd to modify the underlying value. Shoul
alancutter (OOO until 2018)
2015/09/01 00:26:00
Done.
| |
134 } | 135 } |
135 m_cachedValue->type().apply(*appliedInterpolableValue, m_cachedValue->nonInt erpolableValue(), state); | 136 appliedValue->type().apply(appliedValue->interpolableValue(), appliedValue-> nonInterpolableValue(), state); |
136 setFlagIfInheritUsed(state); | 137 setFlagIfInheritUsed(state); |
137 } | 138 } |
138 | 139 |
139 } // namespace blink | 140 } // namespace blink |
OLD | NEW |