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 StyleInterpolation_h | 5 #ifndef StyleInterpolation_h |
6 #define StyleInterpolation_h | 6 #define StyleInterpolation_h |
7 | 7 |
8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "core/animation/Interpolation.h" | 10 #include "core/animation/Interpolation.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class CORE_EXPORT StyleInterpolation : public Interpolation { | 28 class CORE_EXPORT StyleInterpolation : public Interpolation { |
29 public: | 29 public: |
30 // 1) convert m_cachedValue into an X | 30 // 1) convert m_cachedValue into an X |
31 // 2) shove X into StyleResolverState | 31 // 2) shove X into StyleResolverState |
32 // X can be: | 32 // X can be: |
33 // (1) a CSSValue (and applied via StyleBuilder::applyProperty) | 33 // (1) a CSSValue (and applied via StyleBuilder::applyProperty) |
34 // (2) an AnimatableValue (and applied via // AnimatedStyleBuilder::applyPro
perty) | 34 // (2) an AnimatableValue (and applied via // AnimatedStyleBuilder::applyPro
perty) |
35 // (3) a custom value that is inserted directly into the StyleResolverState. | 35 // (3) a custom value that is inserted directly into the StyleResolverState. |
36 virtual void apply(StyleResolverState&) const = 0; | 36 virtual void apply(StyleResolverState&) const = 0; |
37 | 37 |
38 virtual bool isStyleInterpolation() const override final { return true; } | 38 bool isStyleInterpolation() const final { return true; } |
39 virtual bool isDeferredLegacyStyleInterpolation() const { return false; } | 39 virtual bool isDeferredLegacyStyleInterpolation() const { return false; } |
40 | 40 |
41 CSSPropertyID id() const { return m_id; } | 41 CSSPropertyID id() const { return m_id; } |
42 | 42 |
43 virtual PropertyHandle property() const override final | 43 PropertyHandle property() const final |
44 { | 44 { |
45 return PropertyHandle(id()); | 45 return PropertyHandle(id()); |
46 } | 46 } |
47 | 47 |
48 DEFINE_INLINE_VIRTUAL_TRACE() | 48 DEFINE_INLINE_VIRTUAL_TRACE() |
49 { | 49 { |
50 Interpolation::trace(visitor); | 50 Interpolation::trace(visitor); |
51 } | 51 } |
52 | 52 |
53 protected: | 53 protected: |
54 CSSPropertyID m_id; | 54 CSSPropertyID m_id; |
55 | 55 |
56 StyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, PassOwnP
trWillBeRawPtr<InterpolableValue> end, CSSPropertyID id) | 56 StyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, PassOwnP
trWillBeRawPtr<InterpolableValue> end, CSSPropertyID id) |
57 : Interpolation(start, end) | 57 : Interpolation(start, end) |
58 , m_id(id) | 58 , m_id(id) |
59 { | 59 { |
60 } | 60 } |
61 }; | 61 }; |
62 | 62 |
63 DEFINE_TYPE_CASTS(StyleInterpolation, Interpolation, value, value->isStyleInterp
olation(), value.isStyleInterpolation()); | 63 DEFINE_TYPE_CASTS(StyleInterpolation, Interpolation, value, value->isStyleInterp
olation(), value.isStyleInterpolation()); |
64 | 64 |
65 } | 65 } |
66 | 66 |
67 #endif | 67 #endif |
OLD | NEW |