| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 DEFINE_WRAPPERTYPEINFO(); | 51 DEFINE_WRAPPERTYPEINFO(); |
| 52 public: | 52 public: |
| 53 class PlatformTiming : public NoBaseWillBeGarbageCollectedFinalized<Platform
Timing> { | 53 class PlatformTiming : public NoBaseWillBeGarbageCollectedFinalized<Platform
Timing> { |
| 54 | 54 |
| 55 public: | 55 public: |
| 56 // Calls AnimationTimeline's wake() method after duration seconds. | 56 // Calls AnimationTimeline's wake() method after duration seconds. |
| 57 virtual void wakeAfter(double duration) = 0; | 57 virtual void wakeAfter(double duration) = 0; |
| 58 virtual void cancelWake() = 0; | 58 virtual void cancelWake() = 0; |
| 59 virtual void serviceOnNextFrame() = 0; | 59 virtual void serviceOnNextFrame() = 0; |
| 60 virtual ~PlatformTiming() { } | 60 virtual ~PlatformTiming() { } |
| 61 virtual void trace(Visitor*) { } | 61 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 static PassRefPtrWillBeRawPtr<AnimationTimeline> create(Document*, PassOwnPt
rWillBeRawPtr<PlatformTiming> = nullptr); | 64 static PassRefPtrWillBeRawPtr<AnimationTimeline> create(Document*, PassOwnPt
rWillBeRawPtr<PlatformTiming> = nullptr); |
| 65 ~AnimationTimeline(); | 65 ~AnimationTimeline(); |
| 66 | 66 |
| 67 void serviceAnimations(TimingUpdateReason); | 67 void serviceAnimations(TimingUpdateReason); |
| 68 void scheduleNextService(); | 68 void scheduleNextService(); |
| 69 | 69 |
| 70 AnimationPlayer* play(AnimationNode*); | 70 AnimationPlayer* play(AnimationNode*); |
| 71 WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer>> getAnimationPlayers(); | 71 WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer>> getAnimationPlayers(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 96 | 96 |
| 97 void setPlaybackRate(double); | 97 void setPlaybackRate(double); |
| 98 double playbackRate() const; | 98 double playbackRate() const; |
| 99 | 99 |
| 100 Document* document() { return m_document.get(); } | 100 Document* document() { return m_document.get(); } |
| 101 #if !ENABLE(OILPAN) | 101 #if !ENABLE(OILPAN) |
| 102 void detachFromDocument(); | 102 void detachFromDocument(); |
| 103 #endif | 103 #endif |
| 104 void wake(); | 104 void wake(); |
| 105 | 105 |
| 106 void trace(Visitor*); | 106 DECLARE_TRACE(); |
| 107 | 107 |
| 108 protected: | 108 protected: |
| 109 AnimationTimeline(Document*, PassOwnPtrWillBeRawPtr<PlatformTiming>); | 109 AnimationTimeline(Document*, PassOwnPtrWillBeRawPtr<PlatformTiming>); |
| 110 | 110 |
| 111 private: | 111 private: |
| 112 RawPtrWillBeMember<Document> m_document; | 112 RawPtrWillBeMember<Document> m_document; |
| 113 double m_zeroTime; | 113 double m_zeroTime; |
| 114 bool m_zeroTimeInitialized; | 114 bool m_zeroTimeInitialized; |
| 115 // AnimationPlayers which will be updated on the next frame | 115 // AnimationPlayers which will be updated on the next frame |
| 116 // i.e. current, in effect, or had timing changed | 116 // i.e. current, in effect, or had timing changed |
| (...skipping 16 matching lines...) Expand all Loading... |
| 133 { | 133 { |
| 134 ASSERT(m_timeline); | 134 ASSERT(m_timeline); |
| 135 } | 135 } |
| 136 | 136 |
| 137 virtual void wakeAfter(double duration) override; | 137 virtual void wakeAfter(double duration) override; |
| 138 virtual void cancelWake() override; | 138 virtual void cancelWake() override; |
| 139 virtual void serviceOnNextFrame() override; | 139 virtual void serviceOnNextFrame() override; |
| 140 | 140 |
| 141 void timerFired(Timer<AnimationTimelineTiming>*) { m_timeline->wake(); } | 141 void timerFired(Timer<AnimationTimelineTiming>*) { m_timeline->wake(); } |
| 142 | 142 |
| 143 virtual void trace(Visitor*) override; | 143 DECLARE_VIRTUAL_TRACE(); |
| 144 | 144 |
| 145 private: | 145 private: |
| 146 RawPtrWillBeMember<AnimationTimeline> m_timeline; | 146 RawPtrWillBeMember<AnimationTimeline> m_timeline; |
| 147 Timer<AnimationTimelineTiming> m_timer; | 147 Timer<AnimationTimelineTiming> m_timer; |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 friend class AnimationAnimationTimelineTest; | 150 friend class AnimationAnimationTimelineTest; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace blink | 153 } // namespace blink |
| 154 | 154 |
| 155 #endif | 155 #endif |
| OLD | NEW |