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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #ifndef AnimationTimeline_h | 31 #ifndef AnimationTimeline_h |
32 #define AnimationTimeline_h | 32 #define AnimationTimeline_h |
33 | 33 |
34 #include "bindings/core/v8/ScriptWrappable.h" | 34 #include "bindings/core/v8/ScriptWrappable.h" |
35 #include "core/CoreExport.h" | 35 #include "core/CoreExport.h" |
36 #include "core/animation/Animation.h" | 36 #include "core/animation/Animation.h" |
37 #include "core/animation/EffectModel.h" | 37 #include "core/animation/EffectModel.h" |
38 #include "core/dom/Element.h" | 38 #include "core/dom/Element.h" |
39 #include "platform/Timer.h" | 39 #include "platform/Timer.h" |
| 40 #include "platform/animation/CompositorAnimationTimeline.h" |
40 #include "platform/heap/Handle.h" | 41 #include "platform/heap/Handle.h" |
41 #include "public/platform/WebCompositorAnimationTimeline.h" | |
42 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
43 #include "wtf/Vector.h" | 43 #include "wtf/Vector.h" |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 | 46 |
47 class Document; | 47 class Document; |
48 class AnimationEffect; | 48 class AnimationEffect; |
49 | 49 |
50 // AnimationTimeline is constructed and owned by Document, and tied to its lifec
ycle. | 50 // AnimationTimeline is constructed and owned by Document, and tied to its lifec
ycle. |
51 class CORE_EXPORT AnimationTimeline final : public GarbageCollectedFinalized<Ani
mationTimeline>, public ScriptWrappable { | 51 class CORE_EXPORT AnimationTimeline final : public GarbageCollectedFinalized<Ani
mationTimeline>, public ScriptWrappable { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 void setAllCompositorPending(bool sourceChanged = false); | 88 void setAllCompositorPending(bool sourceChanged = false); |
89 void setOutdatedAnimation(Animation*); | 89 void setOutdatedAnimation(Animation*); |
90 void clearOutdatedAnimation(Animation*); | 90 void clearOutdatedAnimation(Animation*); |
91 bool hasOutdatedAnimation() const { return m_outdatedAnimationCount > 0; } | 91 bool hasOutdatedAnimation() const { return m_outdatedAnimationCount > 0; } |
92 bool needsAnimationTimingUpdate(); | 92 bool needsAnimationTimingUpdate(); |
93 | 93 |
94 void setPlaybackRate(double); | 94 void setPlaybackRate(double); |
95 double playbackRate() const; | 95 double playbackRate() const; |
96 | 96 |
97 WebCompositorAnimationTimeline* compositorTimeline() const { return m_compos
itorTimeline.get(); } | 97 CompositorAnimationTimeline* compositorTimeline() const { return m_composito
rTimeline.get(); } |
98 | 98 |
99 Document* document() { return m_document.get(); } | 99 Document* document() { return m_document.get(); } |
100 #if !ENABLE(OILPAN) | 100 #if !ENABLE(OILPAN) |
101 void detachFromDocument(); | 101 void detachFromDocument(); |
102 #endif | 102 #endif |
103 void wake(); | 103 void wake(); |
104 void resetForTesting(); | 104 void resetForTesting(); |
105 | 105 |
106 DECLARE_TRACE(); | 106 DECLARE_TRACE(); |
107 | 107 |
(...skipping 11 matching lines...) Expand all Loading... |
119 HeapHashSet<WeakMember<Animation>> m_animations; | 119 HeapHashSet<WeakMember<Animation>> m_animations; |
120 | 120 |
121 double m_playbackRate; | 121 double m_playbackRate; |
122 | 122 |
123 friend class SMILTimeContainer; | 123 friend class SMILTimeContainer; |
124 static const double s_minimumDelay; | 124 static const double s_minimumDelay; |
125 | 125 |
126 Member<PlatformTiming> m_timing; | 126 Member<PlatformTiming> m_timing; |
127 double m_lastCurrentTimeInternal; | 127 double m_lastCurrentTimeInternal; |
128 | 128 |
129 OwnPtr<WebCompositorAnimationTimeline> m_compositorTimeline; | 129 OwnPtr<CompositorAnimationTimeline> m_compositorTimeline; |
130 | 130 |
131 class AnimationTimelineTiming final : public PlatformTiming { | 131 class AnimationTimelineTiming final : public PlatformTiming { |
132 public: | 132 public: |
133 AnimationTimelineTiming(AnimationTimeline* timeline) | 133 AnimationTimelineTiming(AnimationTimeline* timeline) |
134 : m_timeline(timeline) | 134 : m_timeline(timeline) |
135 , m_timer(this, &AnimationTimelineTiming::timerFired) | 135 , m_timer(this, &AnimationTimelineTiming::timerFired) |
136 { | 136 { |
137 ASSERT(m_timeline); | 137 ASSERT(m_timeline); |
138 } | 138 } |
139 | 139 |
140 void wakeAfter(double duration) override; | 140 void wakeAfter(double duration) override; |
141 void serviceOnNextFrame() override; | 141 void serviceOnNextFrame() override; |
142 | 142 |
143 void timerFired(Timer<AnimationTimelineTiming>*) { m_timeline->wake(); } | 143 void timerFired(Timer<AnimationTimelineTiming>*) { m_timeline->wake(); } |
144 | 144 |
145 DECLARE_VIRTUAL_TRACE(); | 145 DECLARE_VIRTUAL_TRACE(); |
146 | 146 |
147 private: | 147 private: |
148 Member<AnimationTimeline> m_timeline; | 148 Member<AnimationTimeline> m_timeline; |
149 Timer<AnimationTimelineTiming> m_timer; | 149 Timer<AnimationTimelineTiming> m_timer; |
150 }; | 150 }; |
151 | 151 |
152 friend class AnimationAnimationTimelineTest; | 152 friend class AnimationAnimationTimelineTest; |
153 }; | 153 }; |
154 | 154 |
155 } // namespace blink | 155 } // namespace blink |
156 | 156 |
157 #endif | 157 #endif |
OLD | NEW |