| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
| 43 #include "wtf/Vector.h" | 43 #include "wtf/Vector.h" |
| 44 #include <memory> | 44 #include <memory> |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 class Document; | 48 class Document; |
| 49 class AnimationEffect; | 49 class AnimationEffect; |
| 50 | 50 |
| 51 // AnimationTimeline is constructed and owned by Document, and tied to its lifec
ycle. | 51 // AnimationTimeline is constructed and owned by Document, and tied to its lifec
ycle. |
| 52 class CORE_EXPORT AnimationTimeline final : public GarbageCollectedFinalized<Ani
mationTimeline>, public ScriptWrappable { | 52 class CORE_EXPORT AnimationTimeline : public GarbageCollectedFinalized<Animation
Timeline>, public ScriptWrappable { |
| 53 DEFINE_WRAPPERTYPEINFO(); | 53 DEFINE_WRAPPERTYPEINFO(); |
| 54 public: | 54 public: |
| 55 class PlatformTiming : public GarbageCollectedFinalized<PlatformTiming> { | 55 class PlatformTiming : public GarbageCollectedFinalized<PlatformTiming> { |
| 56 public: | 56 public: |
| 57 // Calls AnimationTimeline's wake() method after duration seconds. | 57 // Calls AnimationTimeline's wake() method after duration seconds. |
| 58 virtual void wakeAfter(double duration) = 0; | 58 virtual void wakeAfter(double duration) = 0; |
| 59 virtual void serviceOnNextFrame() = 0; | 59 virtual void serviceOnNextFrame() = 0; |
| 60 virtual ~PlatformTiming() { } | 60 virtual ~PlatformTiming() { } |
| 61 DEFINE_INLINE_VIRTUAL_TRACE() { } | 61 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 static AnimationTimeline* create(Document*, PlatformTiming* = nullptr); | 64 static AnimationTimeline* create(Document*, PlatformTiming* = nullptr); |
| 65 | 65 |
| 66 virtual ~AnimationTimeline() {} |
| 67 |
| 66 void serviceAnimations(TimingUpdateReason); | 68 void serviceAnimations(TimingUpdateReason); |
| 67 void scheduleNextService(); | 69 void scheduleNextService(); |
| 68 | 70 |
| 69 Animation* play(AnimationEffect*); | 71 Animation* play(AnimationEffect*); |
| 70 HeapVector<Member<Animation>> getAnimations(); | 72 HeapVector<Member<Animation>> getAnimations(); |
| 71 | 73 |
| 72 void animationAttached(Animation&); | 74 void animationAttached(Animation&); |
| 73 | 75 |
| 74 bool isActive(); | 76 bool isActive(); |
| 75 bool hasPendingUpdates() const { return !m_animationsNeedingUpdate.isEmpty()
; } | 77 bool hasPendingUpdates() const { return !m_animationsNeedingUpdate.isEmpty()
; } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 Member<AnimationTimeline> m_timeline; | 146 Member<AnimationTimeline> m_timeline; |
| 145 Timer<AnimationTimelineTiming> m_timer; | 147 Timer<AnimationTimelineTiming> m_timer; |
| 146 }; | 148 }; |
| 147 | 149 |
| 148 friend class AnimationAnimationTimelineTest; | 150 friend class AnimationAnimationTimelineTest; |
| 149 }; | 151 }; |
| 150 | 152 |
| 151 } // namespace blink | 153 } // namespace blink |
| 152 | 154 |
| 153 #endif | 155 #endif |
| OLD | NEW |