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 AnimatableDoubleAndBool_h | 5 #ifndef AnimatableDoubleAndBool_h |
6 #define AnimatableDoubleAndBool_h | 6 #define AnimatableDoubleAndBool_h |
7 | 7 |
8 #include "core/animation/animatable/AnimatableValue.h" | 8 #include "core/animation/animatable/AnimatableValue.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class AnimatableDoubleAndBool final : public AnimatableValue { | 12 class AnimatableDoubleAndBool final : public AnimatableValue { |
13 public: | 13 public: |
14 virtual ~AnimatableDoubleAndBool() { } | 14 virtual ~AnimatableDoubleAndBool() { } |
15 static PassRefPtrWillBeRawPtr<AnimatableDoubleAndBool> create(double number,
bool flag) | 15 static PassRefPtrWillBeRawPtr<AnimatableDoubleAndBool> create(double number,
bool flag) |
16 { | 16 { |
17 return adoptRefWillBeNoop(new AnimatableDoubleAndBool(number, flag)); | 17 return adoptRefWillBeNoop(new AnimatableDoubleAndBool(number, flag)); |
18 } | 18 } |
19 | 19 |
20 double toDouble() const { return m_number; } | 20 double toDouble() const { return m_number; } |
21 bool flag() const { return m_flag; } | 21 bool flag() const { return m_flag; } |
22 | 22 |
23 virtual void trace(Visitor* visitor) override { AnimatableValue::trace(visit
or); } | 23 DEFINE_INLINE_VIRTUAL_TRACE() { AnimatableValue::trace(visitor); } |
24 | 24 |
25 protected: | 25 protected: |
26 virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const Animatab
leValue*, double fraction) const override; | 26 virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const Animatab
leValue*, double fraction) const override; |
27 virtual bool usesDefaultInterpolationWith(const AnimatableValue*) const over
ride; | 27 virtual bool usesDefaultInterpolationWith(const AnimatableValue*) const over
ride; |
28 | 28 |
29 private: | 29 private: |
30 AnimatableDoubleAndBool(double number, bool flag) | 30 AnimatableDoubleAndBool(double number, bool flag) |
31 : m_number(number) | 31 : m_number(number) |
32 , m_flag(flag) | 32 , m_flag(flag) |
33 { | 33 { |
34 } | 34 } |
35 virtual AnimatableType type() const override { return TypeDoubleAndBool; } | 35 virtual AnimatableType type() const override { return TypeDoubleAndBool; } |
36 virtual bool equalTo(const AnimatableValue*) const override; | 36 virtual bool equalTo(const AnimatableValue*) const override; |
37 | 37 |
38 double m_number; | 38 double m_number; |
39 bool m_flag; | 39 bool m_flag; |
40 }; | 40 }; |
41 | 41 |
42 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableDoubleAndBool, isDoubleAndBool()); | 42 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableDoubleAndBool, isDoubleAndBool()); |
43 | 43 |
44 } // namespace blink | 44 } // namespace blink |
45 | 45 |
46 #endif // AnimatableDoubleAndBool_h | 46 #endif // AnimatableDoubleAndBool_h |
OLD | NEW |