OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 enum AnimationPolicyOnceAction { | 89 enum AnimationPolicyOnceAction { |
90 // Restart OnceTimer if the timeline is not paused. | 90 // Restart OnceTimer if the timeline is not paused. |
91 RestartOnceTimerIfNotPaused, | 91 RestartOnceTimerIfNotPaused, |
92 // Restart OnceTimer. | 92 // Restart OnceTimer. |
93 RestartOnceTimer, | 93 RestartOnceTimer, |
94 // Cancel OnceTimer. | 94 // Cancel OnceTimer. |
95 CancelOnceTimer | 95 CancelOnceTimer |
96 }; | 96 }; |
97 | 97 |
98 bool isTimelineRunning() const; | 98 bool isTimelineRunning() const; |
99 void scheduleAnimationFrame(SMILTime fireTime); | 99 void synchronizeToDocumentTimeline(); |
100 void scheduleAnimationFrame(double delayTime); | |
100 void cancelAnimationFrame(); | 101 void cancelAnimationFrame(); |
101 void wakeupTimerFired(TimerBase*); | 102 void wakeupTimerFired(TimerBase*); |
102 void scheduleAnimationPolicyTimer(); | 103 void scheduleAnimationPolicyTimer(); |
103 void cancelAnimationPolicyTimer(); | 104 void cancelAnimationPolicyTimer(); |
104 void animationPolicyTimerFired(TimerBase*); | 105 void animationPolicyTimerFired(TimerBase*); |
105 ImageAnimationPolicy animationPolicy() const; | 106 ImageAnimationPolicy animationPolicy() const; |
106 bool handleAnimationPolicy(AnimationPolicyOnceAction); | 107 bool handleAnimationPolicy(AnimationPolicyOnceAction); |
107 void updateAnimationsAndScheduleFrameIfNeeded(SMILTime elapsed, bool seekToT ime = false); | 108 void updateAnimationsAndScheduleFrameIfNeeded(SMILTime elapsed, bool seekToT ime = false); |
108 SMILTime updateAnimations(SMILTime elapsed, bool seekToTime = false); | 109 SMILTime updateAnimations(SMILTime elapsed, bool seekToTime = false); |
109 void serviceOnNextFrame(); | 110 void serviceOnNextFrame(); |
110 void scheduleWakeUp(double delayTime, FrameSchedulingState); | 111 void scheduleWakeUp(double delayTime, FrameSchedulingState); |
111 bool hasPendingSynchronization() const; | 112 bool hasPendingSynchronization() const; |
112 | 113 |
113 void updateDocumentOrderIndexes(); | 114 void updateDocumentOrderIndexes(); |
114 double lastResumeTime() const { return m_resumeTime ? m_resumeTime : m_begin Time; } | |
115 | 115 |
116 SVGSVGElement& ownerSVGElement() const; | 116 SVGSVGElement& ownerSVGElement() const; |
117 Document& document() const; | 117 Document& document() const; |
118 double currentTime() const; | |
119 | 118 |
120 double m_beginTime; | 119 // The latest "restart" time for the time container's timeline. If the |
121 double m_pauseTime; | 120 // timeline has not been manipulated (seeked, paused) this will be zero. |
122 double m_resumeTime; | 121 double m_presentationTime; |
123 double m_accumulatedActiveTime; | 122 // The time on the document timeline corresponding to |m_presentationTime|. |
124 double m_presetStartTime; | 123 double m_referenceTime; |
125 | 124 |
126 FrameSchedulingState m_frameSchedulingState; | 125 FrameSchedulingState m_frameSchedulingState; |
126 bool m_started; // The timeline has been started. | |
pdr.
2016/08/18 19:50:06
We mix "start" and "begin" here. Wdyt about m_hasB
fs
2016/08/18 20:34:32
I guess begin, and variants thereof, would be more
fs
2016/08/19 11:11:24
I ended up going with begin() -> start().
| |
127 bool m_paused; // The timeline is paused. | |
128 | |
127 bool m_documentOrderIndexesDirty; | 129 bool m_documentOrderIndexesDirty; |
128 | 130 |
129 Timer<SMILTimeContainer> m_wakeupTimer; | 131 Timer<SMILTimeContainer> m_wakeupTimer; |
130 Timer<SMILTimeContainer> m_animationPolicyOnceTimer; | 132 Timer<SMILTimeContainer> m_animationPolicyOnceTimer; |
131 | 133 |
132 using ElementAttributePair = std::pair<WeakMember<SVGElement>, QualifiedName >; | 134 using ElementAttributePair = std::pair<WeakMember<SVGElement>, QualifiedName >; |
133 using AnimationsLinkedHashSet = HeapLinkedHashSet<WeakMember<SVGSMILElement> >; | 135 using AnimationsLinkedHashSet = HeapLinkedHashSet<WeakMember<SVGSMILElement> >; |
134 using GroupedAnimationsMap = HeapHashMap<ElementAttributePair, Member<Animat ionsLinkedHashSet>>; | 136 using GroupedAnimationsMap = HeapHashMap<ElementAttributePair, Member<Animat ionsLinkedHashSet>>; |
135 GroupedAnimationsMap m_scheduledAnimations; | 137 GroupedAnimationsMap m_scheduledAnimations; |
136 | 138 |
137 Member<SVGSVGElement> m_ownerSVGElement; | 139 Member<SVGSVGElement> m_ownerSVGElement; |
138 | 140 |
139 #if ENABLE(ASSERT) | 141 #if ENABLE(ASSERT) |
140 bool m_preventScheduledAnimationsChanges; | 142 bool m_preventScheduledAnimationsChanges; |
141 #endif | 143 #endif |
142 }; | 144 }; |
143 } // namespace blink | 145 } // namespace blink |
144 | 146 |
145 #endif // SMILTimeContainer_h | 147 #endif // SMILTimeContainer_h |
OLD | NEW |