| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 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 AnimationValue_h | |
| 6 #define AnimationValue_h | |
| 7 | |
| 8 #include "core/animation/InterpolableValue.h" | |
| 9 #include "core/animation/NonInterpolableValue.h" | |
| 10 #include "platform/heap/Handle.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 class AnimationType; | |
| 15 | |
| 16 class AnimationValue : public NoBaseWillBeGarbageCollectedFinalized<AnimationVal
ue> { | |
| 17 public: | |
| 18 static PassOwnPtrWillBeRawPtr<AnimationValue> create(const AnimationType& ty
pe, PassOwnPtrWillBeRawPtr<InterpolableValue> interpolableValue, PassRefPtrWillB
eRawPtr<NonInterpolableValue> nonInterpolableValue = nullptr) | |
| 19 { | |
| 20 return adoptPtrWillBeNoop(new AnimationValue(type, interpolableValue, no
nInterpolableValue)); | |
| 21 } | |
| 22 | |
| 23 PassOwnPtrWillBeRawPtr<AnimationValue> clone() const | |
| 24 { | |
| 25 return create(m_type, m_interpolableValue->clone(), m_nonInterpolableVal
ue); | |
| 26 } | |
| 27 | |
| 28 const AnimationType& type() const { return m_type; } | |
| 29 const InterpolableValue& interpolableValue() const { return *m_interpolableV
alue; } | |
| 30 InterpolableValue& interpolableValue() { return *m_interpolableValue; } | |
| 31 const NonInterpolableValue* nonInterpolableValue() const { return m_nonInter
polableValue.get(); } | |
| 32 | |
| 33 DEFINE_INLINE_TRACE() | |
| 34 { | |
| 35 visitor->trace(m_interpolableValue); | |
| 36 visitor->trace(m_nonInterpolableValue); | |
| 37 } | |
| 38 | |
| 39 private: | |
| 40 AnimationValue(const AnimationType& type, PassOwnPtrWillBeRawPtr<Interpolabl
eValue> interpolableValue, PassRefPtrWillBeRawPtr<NonInterpolableValue> nonInter
polableValue = nullptr) | |
| 41 : m_type(type) | |
| 42 , m_interpolableValue(interpolableValue) | |
| 43 , m_nonInterpolableValue(nonInterpolableValue) | |
| 44 { | |
| 45 ASSERT(this->m_interpolableValue); | |
| 46 } | |
| 47 | |
| 48 const AnimationType& m_type; | |
| 49 OwnPtrWillBeMember<InterpolableValue> m_interpolableValue; | |
| 50 RefPtrWillBeMember<NonInterpolableValue> m_nonInterpolableValue; | |
| 51 | |
| 52 friend class AnimationType; | |
| 53 }; | |
| 54 | |
| 55 } // namespace blink | |
| 56 | |
| 57 #endif // AnimationValue_h | |
| OLD | NEW |