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 #include "config.h" | 5 #include "config.h" |
6 #include "core/animation/InterpolationEffect.h" | 6 #include "core/animation/InterpolationEffect.h" |
7 | 7 |
8 namespace blink { | 8 namespace blink { |
9 | 9 |
10 void InterpolationEffect::getActiveInterpolations(double fraction, double iterat
ionDuration, OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolatio
n>>>& result) const | 10 void InterpolationEffect::getActiveInterpolations(double fraction, double iterat
ionDuration, OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolatio
n>>>& result) const |
11 { | 11 { |
12 if (!result) | 12 if (!result) |
13 result = adoptPtrWillBeNoop(new WillBeHeapVector<RefPtrWillBeMember<Inte
rpolation> >()); | 13 result = adoptPtrWillBeNoop(new WillBeHeapVector<RefPtrWillBeMember<Inte
rpolation>>()); |
14 | 14 |
15 size_t existingSize = result->size(); | 15 size_t existingSize = result->size(); |
16 size_t resultIndex = 0; | 16 size_t resultIndex = 0; |
17 | 17 |
18 for (const auto& record : m_interpolations) { | 18 for (const auto& record : m_interpolations) { |
19 if (fraction >= record->m_applyFrom && fraction < record->m_applyTo) { | 19 if (fraction >= record->m_applyFrom && fraction < record->m_applyTo) { |
20 RefPtrWillBeRawPtr<Interpolation> interpolation = record->m_interpol
ation; | 20 RefPtrWillBeRawPtr<Interpolation> interpolation = record->m_interpol
ation; |
21 double localFraction = (fraction - record->m_start) / (record->m_end
- record->m_start); | 21 double localFraction = (fraction - record->m_start) / (record->m_end
- record->m_start); |
22 if (record->m_easing) | 22 if (record->m_easing) |
23 localFraction = record->m_easing->evaluate(localFraction, accura
cyForDuration(iterationDuration)); | 23 localFraction = record->m_easing->evaluate(localFraction, accura
cyForDuration(iterationDuration)); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 { | 77 { |
78 visitor->trace(m_interpolation); | 78 visitor->trace(m_interpolation); |
79 } | 79 } |
80 | 80 |
81 DEFINE_TRACE(InterpolationEffect) | 81 DEFINE_TRACE(InterpolationEffect) |
82 { | 82 { |
83 visitor->trace(m_interpolations); | 83 visitor->trace(m_interpolations); |
84 } | 84 } |
85 | 85 |
86 } // namespace blink | 86 } // namespace blink |
OLD | NEW |