| 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 28 matching lines...) Expand all Loading... |
| 39 #include "platform/Timer.h" | 39 #include "platform/Timer.h" |
| 40 #include "platform/animation/CompositorAnimationTimeline.h" | 40 #include "platform/animation/CompositorAnimationTimeline.h" |
| 41 #include "platform/heap/Handle.h" | 41 #include "platform/heap/Handle.h" |
| 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 AnimationEffectReadOnly; |
| 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 : public GarbageCollectedFinalized<Animation
Timeline>, 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() {} | 66 virtual ~AnimationTimeline() {} |
| 67 | 67 |
| 68 void serviceAnimations(TimingUpdateReason); | 68 void serviceAnimations(TimingUpdateReason); |
| 69 void scheduleNextService(); | 69 void scheduleNextService(); |
| 70 | 70 |
| 71 Animation* play(AnimationEffect*); | 71 Animation* play(AnimationEffectReadOnly*); |
| 72 HeapVector<Member<Animation>> getAnimations(); | 72 HeapVector<Member<Animation>> getAnimations(); |
| 73 | 73 |
| 74 void animationAttached(Animation&); | 74 void animationAttached(Animation&); |
| 75 | 75 |
| 76 bool isActive(); | 76 bool isActive(); |
| 77 bool hasPendingUpdates() const { return !m_animationsNeedingUpdate.isEmpty()
; } | 77 bool hasPendingUpdates() const { return !m_animationsNeedingUpdate.isEmpty()
; } |
| 78 double zeroTime(); | 78 double zeroTime(); |
| 79 double currentTime(bool& isNull); | 79 double currentTime(bool& isNull); |
| 80 double currentTime(); | 80 double currentTime(); |
| 81 double currentTimeInternal(bool& isNull); | 81 double currentTimeInternal(bool& isNull); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 Member<AnimationTimeline> m_timeline; | 146 Member<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 |