Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.h

Issue 2261443002: Replace SMILTime with double for elapsed time in SMILTimeContainer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@smilcontainer-canscheduleframe-pred
Patch Set: REbase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * 12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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"
31 #include "platform/Timer.h" 30 #include "platform/Timer.h"
32 #include "platform/graphics/ImageAnimationPolicy.h" 31 #include "platform/graphics/ImageAnimationPolicy.h"
33 #include "platform/heap/Handle.h" 32 #include "platform/heap/Handle.h"
34 #include "wtf/HashMap.h" 33 #include "wtf/HashMap.h"
35 #include "wtf/HashSet.h" 34 #include "wtf/HashSet.h"
36 #include "wtf/text/StringHash.h" 35 #include "wtf/text/StringHash.h"
37 #include "wtf/text/WTFString.h" 36 #include "wtf/text/WTFString.h"
38 37
39 namespace blink { 38 namespace blink {
40 39
41 class Document; 40 class Document;
41 class SMILTime;
42 class SVGElement; 42 class SVGElement;
43 class SVGSMILElement; 43 class SVGSMILElement;
44 class SVGSVGElement; 44 class SVGSVGElement;
45 45
46 class SMILTimeContainer : public GarbageCollectedFinalized<SMILTimeContainer> { 46 class SMILTimeContainer : public GarbageCollectedFinalized<SMILTimeContainer> {
47 public: 47 public:
48 static SMILTimeContainer* create(SVGSVGElement& owner) { return new SMILTime Container(owner); } 48 static SMILTimeContainer* create(SVGSVGElement& owner) { return new SMILTime Container(owner); }
49 ~SMILTimeContainer(); 49 ~SMILTimeContainer();
50 50
51 void schedule(SVGSMILElement*, SVGElement*, const QualifiedName&); 51 void schedule(SVGSMILElement*, SVGElement*, const QualifiedName&);
52 void unschedule(SVGSMILElement*, SVGElement*, const QualifiedName&); 52 void unschedule(SVGSMILElement*, SVGElement*, const QualifiedName&);
53 void notifyIntervalsChanged(); 53 void notifyIntervalsChanged();
54 54
55 SMILTime elapsed() const; 55 double elapsed() const;
56 56
57 bool isPaused() const; 57 bool isPaused() const;
58 bool isStarted() const; 58 bool isStarted() const;
59 59
60 void start(); 60 void start();
61 void pause(); 61 void pause();
62 void resume(); 62 void resume();
63 void setElapsed(SMILTime); 63 void setElapsed(double);
64 64
65 void serviceAnimations(); 65 void serviceAnimations();
66 bool hasAnimations() const; 66 bool hasAnimations() const;
67 67
68 void setDocumentOrderIndexesDirty() { m_documentOrderIndexesDirty = true; } 68 void setDocumentOrderIndexesDirty() { m_documentOrderIndexesDirty = true; }
69 69
70 // Advance the animation timeline a single frame. 70 // Advance the animation timeline a single frame.
71 void advanceFrameForTesting(); 71 void advanceFrameForTesting();
72 72
73 DECLARE_TRACE(); 73 DECLARE_TRACE();
(...skipping 25 matching lines...) Expand all
99 void synchronizeToDocumentTimeline(); 99 void synchronizeToDocumentTimeline();
100 void scheduleAnimationFrame(double delayTime); 100 void scheduleAnimationFrame(double delayTime);
101 void cancelAnimationFrame(); 101 void cancelAnimationFrame();
102 void wakeupTimerFired(TimerBase*); 102 void wakeupTimerFired(TimerBase*);
103 void scheduleAnimationPolicyTimer(); 103 void scheduleAnimationPolicyTimer();
104 void cancelAnimationPolicyTimer(); 104 void cancelAnimationPolicyTimer();
105 void animationPolicyTimerFired(TimerBase*); 105 void animationPolicyTimerFired(TimerBase*);
106 ImageAnimationPolicy animationPolicy() const; 106 ImageAnimationPolicy animationPolicy() const;
107 bool handleAnimationPolicy(AnimationPolicyOnceAction); 107 bool handleAnimationPolicy(AnimationPolicyOnceAction);
108 bool canScheduleFrame(SMILTime earliestFireTime) const; 108 bool canScheduleFrame(SMILTime earliestFireTime) const;
109 void updateAnimationsAndScheduleFrameIfNeeded(SMILTime elapsed, bool seekToT ime = false); 109 void updateAnimationsAndScheduleFrameIfNeeded(double elapsed, bool seekToTim e = false);
110 SMILTime updateAnimations(SMILTime elapsed, bool seekToTime = false); 110 SMILTime updateAnimations(double elapsed, bool seekToTime);
111 void serviceOnNextFrame(); 111 void serviceOnNextFrame();
112 void scheduleWakeUp(double delayTime, FrameSchedulingState); 112 void scheduleWakeUp(double delayTime, FrameSchedulingState);
113 bool hasPendingSynchronization() const; 113 bool hasPendingSynchronization() const;
114 114
115 void updateDocumentOrderIndexes(); 115 void updateDocumentOrderIndexes();
116 116
117 SVGSVGElement& ownerSVGElement() const; 117 SVGSVGElement& ownerSVGElement() const;
118 Document& document() const; 118 Document& document() const;
119 119
120 // The latest "restart" time for the time container's timeline. If the 120 // The latest "restart" time for the time container's timeline. If the
(...skipping 18 matching lines...) Expand all
139 139
140 Member<SVGSVGElement> m_ownerSVGElement; 140 Member<SVGSVGElement> m_ownerSVGElement;
141 141
142 #if ENABLE(ASSERT) 142 #if ENABLE(ASSERT)
143 bool m_preventScheduledAnimationsChanges; 143 bool m_preventScheduledAnimationsChanges;
144 #endif 144 #endif
145 }; 145 };
146 } // namespace blink 146 } // namespace blink
147 147
148 #endif // SMILTimeContainer_h 148 #endif // SMILTimeContainer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698