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 "wtf/Allocator.h" |
10 #include "core/animation/StyleInterpolation.h" | |
11 #include "core/css/CSSValue.h" | |
12 | 10 |
13 namespace blink { | 11 namespace blink { |
14 | 12 |
15 class CSSBasicShapeCircleValue; | 13 class CSSBasicShapeCircleValue; |
16 class CSSBasicShapeEllipseValue; | 14 class CSSBasicShapeEllipseValue; |
17 class CSSBasicShapePolygonValue; | 15 class CSSBasicShapePolygonValue; |
18 class CSSBasicShapeInsetValue; | 16 class CSSBasicShapeInsetValue; |
19 class CSSImageValue; | 17 class CSSImageValue; |
20 class CSSPrimitiveValue; | 18 class CSSPrimitiveValue; |
21 class CSSQuadValue; | 19 class CSSQuadValue; |
22 class CSSShadowValue; | 20 class CSSShadowValue; |
23 class CSSSVGDocumentValue; | 21 class CSSSVGDocumentValue; |
| 22 class CSSValue; |
24 class CSSValueList; | 23 class CSSValueList; |
25 class CSSValuePair; | 24 class CSSValuePair; |
26 | 25 |
27 class CORE_EXPORT DeferredLegacyStyleInterpolation : public StyleInterpolation { | 26 // TODO(alancutter): Remove this once compositor keyframes are no longer snapsho
t during EffectInput::convert(). |
| 27 class CORE_EXPORT DeferredLegacyStyleInterpolation { |
28 public: | 28 public: |
29 static PassRefPtr<DeferredLegacyStyleInterpolation> create(CSSValue* start,
CSSValue* end, CSSPropertyID id) | 29 STATIC_ONLY(DeferredLegacyStyleInterpolation); |
30 { | |
31 return adoptRef(new DeferredLegacyStyleInterpolation(start, end, id)); | |
32 } | |
33 | |
34 void apply(StyleResolverState&) const override; | |
35 | |
36 static bool interpolationRequiresStyleResolve(const CSSValue&); | 30 static bool interpolationRequiresStyleResolve(const CSSValue&); |
37 static bool interpolationRequiresStyleResolve(const CSSPrimitiveValue&); | 31 static bool interpolationRequiresStyleResolve(const CSSPrimitiveValue&); |
38 static bool interpolationRequiresStyleResolve(const CSSImageValue&); | 32 static bool interpolationRequiresStyleResolve(const CSSImageValue&); |
39 static bool interpolationRequiresStyleResolve(const CSSShadowValue&); | 33 static bool interpolationRequiresStyleResolve(const CSSShadowValue&); |
40 static bool interpolationRequiresStyleResolve(const CSSSVGDocumentValue&); | 34 static bool interpolationRequiresStyleResolve(const CSSSVGDocumentValue&); |
41 static bool interpolationRequiresStyleResolve(const CSSValueList&); | 35 static bool interpolationRequiresStyleResolve(const CSSValueList&); |
42 static bool interpolationRequiresStyleResolve(const CSSValuePair&); | 36 static bool interpolationRequiresStyleResolve(const CSSValuePair&); |
43 static bool interpolationRequiresStyleResolve(const CSSBasicShapeCircleValue
&); | 37 static bool interpolationRequiresStyleResolve(const CSSBasicShapeCircleValue
&); |
44 static bool interpolationRequiresStyleResolve(const CSSBasicShapeEllipseValu
e&); | 38 static bool interpolationRequiresStyleResolve(const CSSBasicShapeEllipseValu
e&); |
45 static bool interpolationRequiresStyleResolve(const CSSBasicShapePolygonValu
e&); | 39 static bool interpolationRequiresStyleResolve(const CSSBasicShapePolygonValu
e&); |
46 static bool interpolationRequiresStyleResolve(const CSSBasicShapeInsetValue&
); | 40 static bool interpolationRequiresStyleResolve(const CSSBasicShapeInsetValue&
); |
47 static bool interpolationRequiresStyleResolve(const CSSQuadValue&); | 41 static bool interpolationRequiresStyleResolve(const CSSQuadValue&); |
48 | |
49 private: | |
50 DeferredLegacyStyleInterpolation(CSSValue* start, CSSValue* end, CSSProperty
ID id) | |
51 : StyleInterpolation(InterpolableNumber::create(0), InterpolableNumber::
create(1), id) | |
52 , m_startCSSValue(start) | |
53 , m_endCSSValue(end) | |
54 , m_outdated(true) | |
55 { | |
56 } | |
57 | |
58 Persistent<CSSValue> m_startCSSValue; | |
59 Persistent<CSSValue> m_endCSSValue; | |
60 mutable RefPtr<LegacyStyleInterpolation> m_innerInterpolation; | |
61 mutable bool m_outdated; | |
62 }; | 42 }; |
63 | 43 |
64 } // namespace blink | 44 } // namespace blink |
65 | 45 |
66 #endif | 46 #endif |
OLD | NEW |