| 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 #ifndef DeferredLegacyStyleInterpolation_h | 5 #ifndef DeferredLegacyStyleInterpolation_h |
| 6 #define DeferredLegacyStyleInterpolation_h | 6 #define DeferredLegacyStyleInterpolation_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/animation/LegacyStyleInterpolation.h" | 9 #include "core/animation/LegacyStyleInterpolation.h" |
| 10 #include "core/animation/StyleInterpolation.h" | 10 #include "core/animation/StyleInterpolation.h" |
| 11 #include "core/css/CSSValue.h" | 11 #include "core/css/CSSValue.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class CSSBasicShape; | 15 class CSSBasicShape; |
| 16 class CSSImageValue; | 16 class CSSImageValue; |
| 17 class CSSPrimitiveValue; | 17 class CSSPrimitiveValue; |
| 18 class CSSQuadValue; | 18 class CSSQuadValue; |
| 19 class CSSShadowValue; | 19 class CSSShadowValue; |
| 20 class CSSSVGDocumentValue; | 20 class CSSSVGDocumentValue; |
| 21 class CSSValueList; | 21 class CSSValueList; |
| 22 class CSSValuePair; | 22 class CSSValuePair; |
| 23 | 23 |
| 24 class CORE_EXPORT DeferredLegacyStyleInterpolation : public StyleInterpolation { | 24 class CORE_EXPORT DeferredLegacyStyleInterpolation : public StyleInterpolation { |
| 25 public: | 25 public: |
| 26 static PassRefPtrWillBeRawPtr<DeferredLegacyStyleInterpolation> create(PassR
efPtrWillBeRawPtr<CSSValue> start, PassRefPtrWillBeRawPtr<CSSValue> end, CSSProp
ertyID id) | 26 static PassRefPtr<DeferredLegacyStyleInterpolation> create(PassRefPtrWillBeR
awPtr<CSSValue> start, PassRefPtrWillBeRawPtr<CSSValue> end, CSSPropertyID id) |
| 27 { | 27 { |
| 28 return adoptRefWillBeNoop(new DeferredLegacyStyleInterpolation(start, en
d, id)); | 28 return adoptRef(new DeferredLegacyStyleInterpolation(start, end, id)); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void apply(StyleResolverState&) const override; | 31 void apply(StyleResolverState&) const override; |
| 32 | 32 |
| 33 DECLARE_VIRTUAL_TRACE(); | |
| 34 | |
| 35 static bool interpolationRequiresStyleResolve(const CSSValue&); | 33 static bool interpolationRequiresStyleResolve(const CSSValue&); |
| 36 static bool interpolationRequiresStyleResolve(const CSSPrimitiveValue&); | 34 static bool interpolationRequiresStyleResolve(const CSSPrimitiveValue&); |
| 37 static bool interpolationRequiresStyleResolve(const CSSImageValue&); | 35 static bool interpolationRequiresStyleResolve(const CSSImageValue&); |
| 38 static bool interpolationRequiresStyleResolve(const CSSShadowValue&); | 36 static bool interpolationRequiresStyleResolve(const CSSShadowValue&); |
| 39 static bool interpolationRequiresStyleResolve(const CSSSVGDocumentValue&); | 37 static bool interpolationRequiresStyleResolve(const CSSSVGDocumentValue&); |
| 40 static bool interpolationRequiresStyleResolve(const CSSValueList&); | 38 static bool interpolationRequiresStyleResolve(const CSSValueList&); |
| 41 static bool interpolationRequiresStyleResolve(const CSSValuePair&); | 39 static bool interpolationRequiresStyleResolve(const CSSValuePair&); |
| 42 static bool interpolationRequiresStyleResolve(const CSSBasicShape&); | 40 static bool interpolationRequiresStyleResolve(const CSSBasicShape&); |
| 43 static bool interpolationRequiresStyleResolve(const CSSQuadValue&); | 41 static bool interpolationRequiresStyleResolve(const CSSQuadValue&); |
| 44 | 42 |
| 45 void underlyingStyleChanged() { m_outdated = true; } | 43 void underlyingStyleChanged() { m_outdated = true; } |
| 46 | 44 |
| 47 bool isDeferredLegacyStyleInterpolation() const final { return true; } | 45 bool isDeferredLegacyStyleInterpolation() const final { return true; } |
| 48 | 46 |
| 49 private: | 47 private: |
| 50 DeferredLegacyStyleInterpolation(PassRefPtrWillBeRawPtr<CSSValue> start, Pas
sRefPtrWillBeRawPtr<CSSValue> end, CSSPropertyID id) | 48 DeferredLegacyStyleInterpolation(PassRefPtrWillBeRawPtr<CSSValue> start, Pas
sRefPtrWillBeRawPtr<CSSValue> end, CSSPropertyID id) |
| 51 : StyleInterpolation(InterpolableNumber::create(0), InterpolableNumber::
create(1), id) | 49 : StyleInterpolation(InterpolableNumber::create(0), InterpolableNumber::
create(1), id) |
| 52 , m_startCSSValue(start) | 50 , m_startCSSValue(start) |
| 53 , m_endCSSValue(end) | 51 , m_endCSSValue(end) |
| 54 , m_outdated(true) | 52 , m_outdated(true) |
| 55 { | 53 { |
| 56 } | 54 } |
| 57 | 55 |
| 58 RefPtrWillBeMember<CSSValue> m_startCSSValue; | 56 RefPtrWillBePersistent<CSSValue> m_startCSSValue; |
| 59 RefPtrWillBeMember<CSSValue> m_endCSSValue; | 57 RefPtrWillBePersistent<CSSValue> m_endCSSValue; |
| 60 mutable RefPtrWillBeMember<LegacyStyleInterpolation> m_innerInterpolation; | 58 mutable RefPtr<LegacyStyleInterpolation> m_innerInterpolation; |
| 61 mutable bool m_outdated; | 59 mutable bool m_outdated; |
| 62 }; | 60 }; |
| 63 | 61 |
| 64 DEFINE_TYPE_CASTS(DeferredLegacyStyleInterpolation, StyleInterpolation, value, v
alue->isDeferredLegacyStyleInterpolation(), value.isDeferredLegacyStyleInterpola
tion()); | 62 DEFINE_TYPE_CASTS(DeferredLegacyStyleInterpolation, StyleInterpolation, value, v
alue->isDeferredLegacyStyleInterpolation(), value.isDeferredLegacyStyleInterpola
tion()); |
| 65 | 63 |
| 66 } | 64 } |
| 67 | 65 |
| 68 #endif | 66 #endif |
| OLD | NEW |