OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef LegacyStyleInterpolation_h | |
6 #define LegacyStyleInterpolation_h | |
7 | |
8 #include "core/animation/InterpolableValuePromise.h" | |
9 #include "core/animation/Interpolation.h" | |
10 | |
11 namespace WebCore { | |
12 | |
13 class LegacyStyleInterpolation : public StyleInterpolation { | |
14 public: | |
15 static PassRefPtrWillBeRawPtr<LegacyStyleInterpolation> create(PassRefPtrWil lBeRawPtr<InterpolableValuePromise> start, PassRefPtrWillBeRawPtr<InterpolableVa luePromise> end, CSSPropertyID); | |
16 | |
17 static PassRefPtrWillBeRawPtr<LegacyStyleInterpolation> create(PassRefPtrWil lBeRawPtr<AnimatableValue> start, PassRefPtrWillBeRawPtr<AnimatableValue> end, C SSPropertyID id) | |
shans
2014/05/08 16:12:58
Why do we still have this? The point of Interpolab
| |
18 { | |
19 return adoptRefWillBeNoop(new LegacyStyleInterpolation(InterpolableAnima tableValue::create(start), InterpolableAnimatableValue::create(end), id)); | |
20 } | |
21 | |
22 virtual void apply(StyleResolverState&) const OVERRIDE; | |
23 | |
24 virtual bool isLegacyStyleInterpolation() const OVERRIDE FINAL { return true ; } | |
25 | |
26 PassRefPtrWillBeRawPtr<AnimatableValue> currentValue() const | |
27 { | |
28 InterpolableAnimatableValue* value = static_cast<InterpolableAnimatableV alue*>(m_cachedValue.get()); | |
29 return value ? value->value() : 0; | |
30 } | |
31 | |
32 virtual void trace(Visitor*) OVERRIDE; | |
33 | |
34 private: | |
35 LegacyStyleInterpolation(PassRefPtrWillBeRawPtr<InterpolableValuePromise> st art, PassRefPtrWillBeRawPtr<InterpolableValuePromise> end, CSSPropertyID id) | |
36 : StyleInterpolation(nullptr, nullptr, id) | |
37 , m_startPromise(start) | |
38 , m_endPromise(end) | |
39 { | |
40 } | |
41 | |
42 LegacyStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> startValu e, PassOwnPtrWillBeRawPtr<InterpolableValue> endValue, CSSPropertyID id) | |
43 : StyleInterpolation(startValue, endValue, id) | |
44 , m_startPromise(nullptr) | |
45 , m_endPromise(nullptr) | |
46 { | |
47 } | |
48 | |
49 const RefPtrWillBeMember<InterpolableValuePromise> m_startPromise; | |
50 const RefPtrWillBeMember<InterpolableValuePromise> m_endPromise; | |
51 }; | |
52 | |
53 DEFINE_TYPE_CASTS(LegacyStyleInterpolation, Interpolation, value, value->isLegac yStyleInterpolation(), value.isLegacyStyleInterpolation()); | |
54 | |
55 } | |
56 | |
57 #endif | |
OLD | NEW |