| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/DeferredLegacyStyleInterpolation.h" | 6 #include "core/animation/DeferredLegacyStyleInterpolation.h" |
| 7 | 7 |
| 8 #include "core/animation/ElementAnimations.h" | 8 #include "core/animation/ElementAnimations.h" |
| 9 #include "core/animation/css/CSSAnimatableValueFactory.h" | 9 #include "core/animation/css/CSSAnimatableValueFactory.h" |
| 10 #include "core/css/CSSBasicShapes.h" | 10 #include "core/css/CSSBasicShapes.h" |
| 11 #include "core/css/CSSImageValue.h" | 11 #include "core/css/CSSImageValue.h" |
| 12 #include "core/css/CSSPrimitiveValue.h" | 12 #include "core/css/CSSPrimitiveValue.h" |
| 13 #include "core/css/CSSQuadValue.h" | 13 #include "core/css/CSSQuadValue.h" |
| 14 #include "core/css/CSSSVGDocumentValue.h" | 14 #include "core/css/CSSSVGDocumentValue.h" |
| 15 #include "core/css/CSSShadowValue.h" | 15 #include "core/css/CSSShadowValue.h" |
| 16 #include "core/css/CSSValueList.h" | 16 #include "core/css/CSSValueList.h" |
| 17 #include "core/css/CSSValuePair.h" | 17 #include "core/css/CSSValuePair.h" |
| 18 #include "core/css/resolver/StyleResolver.h" | 18 #include "core/css/resolver/StyleResolver.h" |
| 19 #include "core/css/resolver/StyleResolverState.h" | 19 #include "core/css/resolver/StyleResolverState.h" |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 | 22 |
| 23 void DeferredLegacyStyleInterpolation::apply(StyleResolverState& state) const | 23 void DeferredLegacyStyleInterpolation::apply(StyleResolverState& state) const |
| 24 { | 24 { |
| 25 if (m_outdated || !state.element()->elementAnimations() || !state.element()-
>elementAnimations()->isAnimationStyleChange()) { | 25 if (m_outdated || !state.element()->elementAnimations() || !state.element()-
>elementAnimations()->isAnimationStyleChange()) { |
| 26 RefPtrWillBeRawPtr<AnimatableValue> startAnimatableValue; | 26 RefPtr<AnimatableValue> startAnimatableValue; |
| 27 RefPtrWillBeRawPtr<AnimatableValue> endAnimatableValue; | 27 RefPtr<AnimatableValue> endAnimatableValue; |
| 28 | 28 |
| 29 // Snapshot underlying values for neutral keyframes first because non-ne
utral keyframes will mutate the StyleResolverState. | 29 // Snapshot underlying values for neutral keyframes first because non-ne
utral keyframes will mutate the StyleResolverState. |
| 30 if (!m_endCSSValue) { | 30 if (!m_endCSSValue) { |
| 31 endAnimatableValue = StyleResolver::createAnimatableValueSnapshot(st
ate, m_id, m_endCSSValue.get()); | 31 endAnimatableValue = StyleResolver::createAnimatableValueSnapshot(st
ate, m_id, m_endCSSValue.get()); |
| 32 startAnimatableValue = StyleResolver::createAnimatableValueSnapshot(
state, m_id, m_startCSSValue.get()); | 32 startAnimatableValue = StyleResolver::createAnimatableValueSnapshot(
state, m_id, m_startCSSValue.get()); |
| 33 } else { | 33 } else { |
| 34 startAnimatableValue = StyleResolver::createAnimatableValueSnapshot(
state, m_id, m_startCSSValue.get()); | 34 startAnimatableValue = StyleResolver::createAnimatableValueSnapshot(
state, m_id, m_startCSSValue.get()); |
| 35 endAnimatableValue = StyleResolver::createAnimatableValueSnapshot(st
ate, m_id, m_endCSSValue.get()); | 35 endAnimatableValue = StyleResolver::createAnimatableValueSnapshot(st
ate, m_id, m_endCSSValue.get()); |
| 36 } | 36 } |
| 37 | 37 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C
SSQuadValue& quad) | 143 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C
SSQuadValue& quad) |
| 144 { | 144 { |
| 145 return interpolationRequiresStyleResolve(*quad.top()) | 145 return interpolationRequiresStyleResolve(*quad.top()) |
| 146 || interpolationRequiresStyleResolve(*quad.right()) | 146 || interpolationRequiresStyleResolve(*quad.right()) |
| 147 || interpolationRequiresStyleResolve(*quad.bottom()) | 147 || interpolationRequiresStyleResolve(*quad.bottom()) |
| 148 || interpolationRequiresStyleResolve(*quad.left()); | 148 || interpolationRequiresStyleResolve(*quad.left()); |
| 149 } | 149 } |
| 150 | 150 |
| 151 DEFINE_TRACE(DeferredLegacyStyleInterpolation) | |
| 152 { | |
| 153 visitor->trace(m_startCSSValue); | |
| 154 visitor->trace(m_endCSSValue); | |
| 155 visitor->trace(m_innerInterpolation); | |
| 156 StyleInterpolation::trace(visitor); | |
| 157 } | 151 } |
| 158 | |
| 159 } | |
| OLD | NEW |