| 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 AnimatableDoubleAndBool* create(double number, bool flag) |
| 17 { | 17 { |
| 18 return adoptRefWillBeNoop(new AnimatableDoubleAndBool(number, flag)); | 18 return 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); } | 24 DEFINE_INLINE_VIRTUAL_TRACE() { AnimatableValue::trace(visitor); } |
| 25 | 25 |
| 26 protected: | 26 protected: |
| 27 PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*
, double fraction) const override; | 27 AnimatableValue* interpolateTo(const AnimatableValue*, double fraction) cons
t override; |
| 28 bool usesDefaultInterpolationWith(const AnimatableValue*) const override; | 28 bool usesDefaultInterpolationWith(const AnimatableValue*) const override; |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 AnimatableDoubleAndBool(double number, bool flag) | 31 AnimatableDoubleAndBool(double number, bool flag) |
| 32 : m_number(number) | 32 : m_number(number) |
| 33 , m_flag(flag) | 33 , m_flag(flag) |
| 34 { | 34 { |
| 35 } | 35 } |
| 36 AnimatableType type() const override { return TypeDoubleAndBool; } | 36 AnimatableType type() const override { return TypeDoubleAndBool; } |
| 37 bool equalTo(const AnimatableValue*) const override; | 37 bool equalTo(const AnimatableValue*) const override; |
| 38 | 38 |
| 39 double m_number; | 39 double m_number; |
| 40 bool m_flag; | 40 bool m_flag; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableDoubleAndBool, isDoubleAndBool()); | 43 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableDoubleAndBool, isDoubleAndBool()); |
| 44 | 44 |
| 45 } // namespace blink | 45 } // namespace blink |
| 46 | 46 |
| 47 #endif // AnimatableDoubleAndBool_h | 47 #endif // AnimatableDoubleAndBool_h |
| OLD | NEW |