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