| 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 { | 53 class PlatformTiming { |
| 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*) { } | |
| 62 }; | 61 }; |
| 63 | 62 |
| 64 static PassRefPtr<AnimationTimeline> create(Document*, PassOwnPtr<PlatformTi
ming> = nullptr); | 63 static PassRefPtr<AnimationTimeline> create(Document*, PassOwnPtr<PlatformTi
ming> = nullptr); |
| 65 ~AnimationTimeline(); | 64 ~AnimationTimeline(); |
| 66 | 65 |
| 67 void serviceAnimations(TimingUpdateReason); | 66 void serviceAnimations(TimingUpdateReason); |
| 68 | 67 |
| 69 // Creates a player attached to this timeline, but without a start time. | 68 // Creates a player attached to this timeline, but without a start time. |
| 70 AnimationPlayer* createAnimationPlayer(AnimationNode*); | 69 AnimationPlayer* createAnimationPlayer(AnimationNode*); |
| 71 AnimationPlayer* play(AnimationNode*); | 70 AnimationPlayer* play(AnimationNode*); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 90 | 89 |
| 91 void setOutdatedAnimationPlayer(AnimationPlayer*); | 90 void setOutdatedAnimationPlayer(AnimationPlayer*); |
| 92 bool hasOutdatedAnimationPlayer() const; | 91 bool hasOutdatedAnimationPlayer() const; |
| 93 | 92 |
| 94 Document* document() { return m_document.get(); } | 93 Document* document() { return m_document.get(); } |
| 95 #if !ENABLE(OILPAN) | 94 #if !ENABLE(OILPAN) |
| 96 void detachFromDocument(); | 95 void detachFromDocument(); |
| 97 #endif | 96 #endif |
| 98 void wake(); | 97 void wake(); |
| 99 | 98 |
| 100 void trace(Visitor*); | |
| 101 | |
| 102 protected: | 99 protected: |
| 103 AnimationTimeline(Document*, PassOwnPtr<PlatformTiming>); | 100 AnimationTimeline(Document*, PassOwnPtr<PlatformTiming>); |
| 104 | 101 |
| 105 private: | 102 private: |
| 106 RawPtr<Document> m_document; | 103 RawPtr<Document> m_document; |
| 107 // AnimationPlayers which will be updated on the next frame | 104 // AnimationPlayers which will be updated on the next frame |
| 108 // i.e. current, in effect, or had timing changed | 105 // i.e. current, in effect, or had timing changed |
| 109 HashSet<RefPtr<AnimationPlayer> > m_playersNeedingUpdate; | 106 HashSet<RefPtr<AnimationPlayer> > m_playersNeedingUpdate; |
| 110 HashSet<RawPtr<AnimationPlayer> > m_players; | 107 HashSet<RawPtr<AnimationPlayer> > m_players; |
| 111 | 108 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 122 { | 119 { |
| 123 ASSERT(m_timeline); | 120 ASSERT(m_timeline); |
| 124 } | 121 } |
| 125 | 122 |
| 126 virtual void wakeAfter(double duration) override; | 123 virtual void wakeAfter(double duration) override; |
| 127 virtual void cancelWake() override; | 124 virtual void cancelWake() override; |
| 128 virtual void serviceOnNextFrame() override; | 125 virtual void serviceOnNextFrame() override; |
| 129 | 126 |
| 130 void timerFired(Timer<AnimationTimelineTiming>*) { m_timeline->wake(); } | 127 void timerFired(Timer<AnimationTimelineTiming>*) { m_timeline->wake(); } |
| 131 | 128 |
| 132 virtual void trace(Visitor*) override; | |
| 133 | |
| 134 private: | 129 private: |
| 135 RawPtr<AnimationTimeline> m_timeline; | 130 RawPtr<AnimationTimeline> m_timeline; |
| 136 Timer<AnimationTimelineTiming> m_timer; | 131 Timer<AnimationTimelineTiming> m_timer; |
| 137 }; | 132 }; |
| 138 | 133 |
| 139 friend class AnimationAnimationTimelineTest; | 134 friend class AnimationAnimationTimelineTest; |
| 140 }; | 135 }; |
| 141 | 136 |
| 142 } // namespace blink | 137 } // namespace blink |
| 143 | 138 |
| 144 #endif | 139 #endif |
| OLD | NEW |