| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 AnimatablePath_h | 5 #ifndef AnimatablePath_h |
| 6 #define AnimatablePath_h | 6 #define AnimatablePath_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 #include "core/style/StylePath.h" | 10 #include "core/style/StylePath.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class CORE_EXPORT AnimatablePath final : public AnimatableValue { | 14 class AnimatablePath final : public AnimatableValue { |
| 15 public: | 15 public: |
| 16 ~AnimatablePath() override {} | 16 ~AnimatablePath() override {} |
| 17 static PassRefPtr<AnimatablePath> create(PassRefPtr<StylePath> path) { | 17 static PassRefPtr<AnimatablePath> create(PassRefPtr<StylePath> path) { |
| 18 return adoptRef(new AnimatablePath(std::move(path))); | 18 return adoptRef(new AnimatablePath(std::move(path))); |
| 19 } | 19 } |
| 20 | 20 |
| 21 StylePath* path() const { return m_path.get(); } | |
| 22 | |
| 23 protected: | |
| 24 PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, | |
| 25 double fraction) const override; | |
| 26 bool usesDefaultInterpolationWith(const AnimatableValue*) const override; | |
| 27 | |
| 28 private: | 21 private: |
| 29 explicit AnimatablePath(PassRefPtr<StylePath> path) : m_path(path) {} | 22 explicit AnimatablePath(PassRefPtr<StylePath> path) : m_path(path) {} |
| 30 AnimatableType type() const override { return TypePath; } | 23 AnimatableType type() const override { return TypePath; } |
| 31 bool equalTo(const AnimatableValue*) const override; | 24 bool equalTo(const AnimatableValue*) const override; |
| 32 const RefPtr<StylePath> m_path; | 25 const RefPtr<StylePath> m_path; |
| 33 }; | 26 }; |
| 34 | 27 |
| 35 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatablePath, isPath()); | 28 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatablePath, isPath()); |
| 36 | 29 |
| 37 } // namespace blink | 30 } // namespace blink |
| 38 | 31 |
| 39 #endif // AnimatablePath_h | 32 #endif // AnimatablePath_h |
| OLD | NEW |