Chromium Code Reviews| 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 InterpolationEffect_h | 5 #ifndef InterpolationEffect_h |
| 6 #define InterpolationEffect_h | 6 #define InterpolationEffect_h |
| 7 | 7 |
| 8 #include "core/animation/DeferredLegacyStyleInterpolation.h" | |
| 8 #include "core/animation/Interpolation.h" | 9 #include "core/animation/Interpolation.h" |
| 10 #include "core/animation/StyleInterpolation.h" | |
| 9 #include "platform/animation/TimingFunction.h" | 11 #include "platform/animation/TimingFunction.h" |
| 10 #include "wtf/PassOwnPtr.h" | 12 #include "wtf/PassOwnPtr.h" |
| 11 #include "wtf/RefCounted.h" | 13 #include "wtf/RefCounted.h" |
| 12 | 14 |
| 13 namespace blink { | 15 namespace blink { |
| 14 | 16 |
| 15 class InterpolationEffect : public RefCountedWillBeGarbageCollected<Interpolatio nEffect> { | 17 class InterpolationEffect : public RefCountedWillBeGarbageCollected<Interpolatio nEffect> { |
| 16 public: | 18 public: |
| 17 static PassRefPtrWillBeRawPtr<InterpolationEffect> create() | 19 static PassRefPtrWillBeRawPtr<InterpolationEffect> create() |
| 18 { | 20 { |
| 19 return adoptRefWillBeNoop(new InterpolationEffect()); | 21 return adoptRefWillBeNoop(new InterpolationEffect()); |
| 20 } | 22 } |
| 21 | 23 |
| 22 void getActiveInterpolations(double fraction, double iterationDuration, OwnP trWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>>&) const; | 24 void getActiveInterpolations(double fraction, double iterationDuration, OwnP trWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>>&) const; |
| 23 | 25 |
| 24 void addInterpolation(PassRefPtrWillBeRawPtr<Interpolation> interpolation, P assRefPtr<TimingFunction> easing, double start, double end, double applyFrom, do uble applyTo) | 26 void addInterpolation(PassRefPtrWillBeRawPtr<Interpolation> interpolation, P assRefPtr<TimingFunction> easing, double start, double end, double applyFrom, do uble applyTo) |
| 25 { | 27 { |
| 26 m_interpolations.append(InterpolationRecord::create(interpolation, easin g, start, end, applyFrom, applyTo)); | 28 m_interpolations.append(InterpolationRecord::create(interpolation, easin g, start, end, applyFrom, applyTo)); |
| 27 } | 29 } |
| 28 | 30 |
| 31 void setDeferredInterpolationsOutdated(bool outdated) | |
| 32 { | |
| 33 for (auto &record : m_interpolations) { | |
|
Timothy Loh
2015/01/20 05:29:32
auto& :)
shend
2015/01/20 23:13:03
Done.
| |
| 34 if (record->m_interpolation->isStyleInterpolation() && toStyleInterp olation(record->m_interpolation.get())->isDeferredLegacyStyleInterpolation()) { | |
| 35 toDeferredLegacyStyleInterpolation(toStyleInterpolation(record-> m_interpolation.get()))->setOutdated(outdated); | |
| 36 } | |
| 37 } | |
| 38 } | |
| 39 | |
| 29 void trace(Visitor*); | 40 void trace(Visitor*); |
| 30 | 41 |
| 31 private: | 42 private: |
| 32 InterpolationEffect() | 43 InterpolationEffect() |
| 33 { | 44 { |
| 34 } | 45 } |
| 35 | 46 |
| 36 class InterpolationRecord : public NoBaseWillBeGarbageCollectedFinalized<Int erpolationRecord> { | 47 class InterpolationRecord : public NoBaseWillBeGarbageCollectedFinalized<Int erpolationRecord> { |
| 37 public: | 48 public: |
| 38 RefPtrWillBeMember<Interpolation> m_interpolation; | 49 RefPtrWillBeMember<Interpolation> m_interpolation; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 60 { | 71 { |
| 61 } | 72 } |
| 62 }; | 73 }; |
| 63 | 74 |
| 64 WillBeHeapVector<OwnPtrWillBeMember<InterpolationRecord> > m_interpolations; | 75 WillBeHeapVector<OwnPtrWillBeMember<InterpolationRecord> > m_interpolations; |
| 65 }; | 76 }; |
| 66 | 77 |
| 67 } // namespace blink | 78 } // namespace blink |
| 68 | 79 |
| 69 #endif // InterpolationEffect_h | 80 #endif // InterpolationEffect_h |
| OLD | NEW |