Chromium Code Reviews| 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 11 matching lines...) Expand all Loading... | |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef SMILTimeContainer_h | 26 #ifndef SMILTimeContainer_h |
| 27 #define SMILTimeContainer_h | 27 #define SMILTimeContainer_h |
| 28 | 28 |
| 29 #include "core/dom/QualifiedName.h" | 29 #include "core/dom/QualifiedName.h" |
| 30 #include "core/svg/animation/SMILTime.h" | 30 #include "core/svg/animation/SMILTime.h" |
| 31 #include "platform/Timer.h" | 31 #include "platform/Timer.h" |
| 32 #include "platform/graphics/ImageAnimationPolicy.h" | |
| 32 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
| 33 #include "wtf/HashMap.h" | 34 #include "wtf/HashMap.h" |
| 34 #include "wtf/HashSet.h" | 35 #include "wtf/HashSet.h" |
| 35 #include "wtf/PassRefPtr.h" | 36 #include "wtf/PassRefPtr.h" |
| 36 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" |
| 37 #include "wtf/text/StringHash.h" | 38 #include "wtf/text/StringHash.h" |
| 38 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| 41 | 42 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 // Scheduled a wakeup to trigger an animation frame. | 82 // Scheduled a wakeup to trigger an animation frame. |
| 82 FutureAnimationFrame, | 83 FutureAnimationFrame, |
| 83 // Scheduled a animation frame for continuous update. | 84 // Scheduled a animation frame for continuous update. |
| 84 AnimationFrame | 85 AnimationFrame |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 bool isTimelineRunning() const; | 88 bool isTimelineRunning() const; |
| 88 void scheduleAnimationFrame(SMILTime fireTime); | 89 void scheduleAnimationFrame(SMILTime fireTime); |
| 89 void cancelAnimationFrame(); | 90 void cancelAnimationFrame(); |
| 90 void wakeupTimerFired(Timer<SMILTimeContainer>*); | 91 void wakeupTimerFired(Timer<SMILTimeContainer>*); |
| 92 void scheduleAnimationPolicyTimer(); | |
| 93 void cancelAnimationPolicyTimer(); | |
| 94 void animationPolicyTimerFired(Timer<SMILTimeContainer>*); | |
| 95 ImageAnimationPolicy animationPolicy() const; | |
| 96 bool handleAnimationPolicy(bool cancelTimer, bool checkPausedState); | |
|
fs
2014/12/25 17:32:08
These bools make for very hard to read code at the
je_julie(Not used)
2014/12/27 07:08:54
Thanks! I followed your suggestion.
| |
| 91 void updateAnimationsAndScheduleFrameIfNeeded(SMILTime elapsed, bool seekToT ime = false); | 97 void updateAnimationsAndScheduleFrameIfNeeded(SMILTime elapsed, bool seekToT ime = false); |
| 92 SMILTime updateAnimations(SMILTime elapsed, bool seekToTime = false); | 98 SMILTime updateAnimations(SMILTime elapsed, bool seekToTime = false); |
| 93 void serviceOnNextFrame(); | 99 void serviceOnNextFrame(); |
| 94 void scheduleWakeUp(double delayTime, FrameSchedulingState); | 100 void scheduleWakeUp(double delayTime, FrameSchedulingState); |
| 95 bool hasPendingSynchronization() const; | 101 bool hasPendingSynchronization() const; |
| 96 | 102 |
| 97 void updateDocumentOrderIndexes(); | 103 void updateDocumentOrderIndexes(); |
| 98 double lastResumeTime() const { return m_resumeTime ? m_resumeTime : m_begin Time; } | 104 double lastResumeTime() const { return m_resumeTime ? m_resumeTime : m_begin Time; } |
| 99 | 105 |
| 100 Document& document() const; | 106 Document& document() const; |
| 101 double currentTime() const; | 107 double currentTime() const; |
| 102 | 108 |
| 103 double m_beginTime; | 109 double m_beginTime; |
| 104 double m_pauseTime; | 110 double m_pauseTime; |
| 105 double m_resumeTime; | 111 double m_resumeTime; |
| 106 double m_accumulatedActiveTime; | 112 double m_accumulatedActiveTime; |
| 107 double m_presetStartTime; | 113 double m_presetStartTime; |
| 108 | 114 |
| 109 FrameSchedulingState m_frameSchedulingState; | 115 FrameSchedulingState m_frameSchedulingState; |
| 110 bool m_documentOrderIndexesDirty; | 116 bool m_documentOrderIndexesDirty; |
| 111 | 117 |
| 112 Timer<SMILTimeContainer> m_wakeupTimer; | 118 Timer<SMILTimeContainer> m_wakeupTimer; |
| 119 Timer<SMILTimeContainer> m_animationPolicyOnceTimer; | |
| 113 | 120 |
| 114 using ElementAttributePair = pair<RawPtrWillBeWeakMember<SVGElement>, Qualif iedName>; | 121 using ElementAttributePair = pair<RawPtrWillBeWeakMember<SVGElement>, Qualif iedName>; |
| 115 using AnimationsLinkedHashSet = WillBeHeapLinkedHashSet<RawPtrWillBeWeakMemb er<SVGSMILElement>>; | 122 using AnimationsLinkedHashSet = WillBeHeapLinkedHashSet<RawPtrWillBeWeakMemb er<SVGSMILElement>>; |
| 116 using GroupedAnimationsMap = WillBeHeapHashMap<ElementAttributePair, OwnPtrW illBeMember<AnimationsLinkedHashSet>>; | 123 using GroupedAnimationsMap = WillBeHeapHashMap<ElementAttributePair, OwnPtrW illBeMember<AnimationsLinkedHashSet>>; |
| 117 GroupedAnimationsMap m_scheduledAnimations; | 124 GroupedAnimationsMap m_scheduledAnimations; |
| 118 | 125 |
| 119 SVGSVGElement& m_ownerSVGElement; | 126 SVGSVGElement& m_ownerSVGElement; |
| 120 | 127 |
| 121 #if ENABLE(ASSERT) | 128 #if ENABLE(ASSERT) |
| 122 bool m_preventScheduledAnimationsChanges; | 129 bool m_preventScheduledAnimationsChanges; |
| 123 #endif | 130 #endif |
| 124 }; | 131 }; |
| 125 } | 132 } |
| 126 | 133 |
| 127 #endif // SMILTimeContainer_h | 134 #endif // SMILTimeContainer_h |
| OLD | NEW |