| 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 PrimitiveInterpolation_h | 5 #ifndef PrimitiveInterpolation_h |
| 6 #define PrimitiveInterpolation_h | 6 #define PrimitiveInterpolation_h |
| 7 | 7 |
| 8 #include "core/animation/TypedInterpolationValue.h" | 8 #include "core/animation/TypedInterpolationValue.h" |
| 9 #include "platform/animation/AnimationUtilities.h" | 9 #include "platform/animation/AnimationUtilities.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 PrimitiveInterpolation() { } | 33 PrimitiveInterpolation() { } |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // Represents a pair of keyframes that are compatible for "smooth" interpolation
eg. "0px" and "100px". | 36 // Represents a pair of keyframes that are compatible for "smooth" interpolation
eg. "0px" and "100px". |
| 37 class PairwisePrimitiveInterpolation : public PrimitiveInterpolation { | 37 class PairwisePrimitiveInterpolation : public PrimitiveInterpolation { |
| 38 public: | 38 public: |
| 39 ~PairwisePrimitiveInterpolation() override { } | 39 ~PairwisePrimitiveInterpolation() override { } |
| 40 | 40 |
| 41 static std::unique_ptr<PairwisePrimitiveInterpolation> create(const Interpol
ationType& type, std::unique_ptr<InterpolableValue> start, std::unique_ptr<Inter
polableValue> end, PassRefPtr<NonInterpolableValue> nonInterpolableValue) | 41 static std::unique_ptr<PairwisePrimitiveInterpolation> create(const Interpol
ationType& type, std::unique_ptr<InterpolableValue> start, std::unique_ptr<Inter
polableValue> end, PassRefPtr<NonInterpolableValue> nonInterpolableValue) |
| 42 { | 42 { |
| 43 return wrapUnique(new PairwisePrimitiveInterpolation(type, std::move(sta
rt), std::move(end), nonInterpolableValue)); | 43 return wrapUnique(new PairwisePrimitiveInterpolation(type, std::move(sta
rt), std::move(end), std::move(nonInterpolableValue))); |
| 44 } | 44 } |
| 45 | 45 |
| 46 const InterpolationType& type() const { return m_type; } | 46 const InterpolationType& type() const { return m_type; } |
| 47 | 47 |
| 48 std::unique_ptr<TypedInterpolationValue> initialValue() const | 48 std::unique_ptr<TypedInterpolationValue> initialValue() const |
| 49 { | 49 { |
| 50 return TypedInterpolationValue::create(m_type, m_start->clone(), m_nonIn
terpolableValue); | 50 return TypedInterpolationValue::create(m_type, m_start->clone(), m_nonIn
terpolableValue); |
| 51 } | 51 } |
| 52 | 52 |
| 53 private: | 53 private: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 bool isFlip() const final { return true; } | 109 bool isFlip() const final { return true; } |
| 110 | 110 |
| 111 std::unique_ptr<TypedInterpolationValue> m_start; | 111 std::unique_ptr<TypedInterpolationValue> m_start; |
| 112 std::unique_ptr<TypedInterpolationValue> m_end; | 112 std::unique_ptr<TypedInterpolationValue> m_end; |
| 113 mutable double m_lastFraction; | 113 mutable double m_lastFraction; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace blink | 116 } // namespace blink |
| 117 | 117 |
| 118 #endif // PrimitiveInterpolation_h | 118 #endif // PrimitiveInterpolation_h |
| OLD | NEW |