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

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

Issue 2592103002: Improve separation between "SMIL times" and timestamps (Closed)
Patch Set: Created 3 years, 12 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 SMILTime repeatCount() const; 78 SMILTime repeatCount() const;
79 SMILTime maxValue() const; 79 SMILTime maxValue() const;
80 SMILTime minValue() const; 80 SMILTime minValue() const;
81 81
82 SMILTime elapsed() const; 82 SMILTime elapsed() const;
83 83
84 SMILTime intervalBegin() const { return m_interval.begin; } 84 SMILTime intervalBegin() const { return m_interval.begin; }
85 SMILTime previousIntervalBegin() const { return m_previousIntervalBegin; } 85 SMILTime previousIntervalBegin() const { return m_previousIntervalBegin; }
86 SMILTime simpleDuration() const; 86 SMILTime simpleDuration() const;
87 87
88 void seekToIntervalCorrespondingToTime(SMILTime elapsed); 88 void seekToIntervalCorrespondingToTime(double elapsed);
89 bool progress(SMILTime elapsed, bool seekToTime); 89 bool progress(double elapsed, bool seekToTime);
90 SMILTime nextProgressTime() const; 90 SMILTime nextProgressTime() const;
91 void updateAnimatedValue(SVGSMILElement* resultElement) { 91 void updateAnimatedValue(SVGSMILElement* resultElement) {
92 updateAnimation(m_lastPercent, m_lastRepeat, resultElement); 92 updateAnimation(m_lastPercent, m_lastRepeat, resultElement);
93 } 93 }
94 94
95 void reset(); 95 void reset();
96 96
97 static SMILTime parseClockValue(const String&); 97 static SMILTime parseClockValue(const String&);
98 static SMILTime parseOffsetValue(const String&); 98 static SMILTime parseOffsetValue(const String&);
99 99
100 bool isContributing(SMILTime elapsed) const; 100 bool isContributing(double elapsed) const;
101 bool isFrozen() const; 101 bool isFrozen() const;
102 102
103 unsigned documentOrderIndex() const { return m_documentOrderIndex; } 103 unsigned documentOrderIndex() const { return m_documentOrderIndex; }
104 void setDocumentOrderIndex(unsigned index) { m_documentOrderIndex = index; } 104 void setDocumentOrderIndex(unsigned index) { m_documentOrderIndex = index; }
105 105
106 virtual void resetAnimatedType() = 0; 106 virtual void resetAnimatedType() = 0;
107 virtual void clearAnimatedType() = 0; 107 virtual void clearAnimatedType() = 0;
108 virtual void applyResultsToTarget() = 0; 108 virtual void applyResultsToTarget() = 0;
109 109
110 bool animatedTypeIsLocked() const { return m_animatedPropertyLocked; } 110 bool animatedTypeIsLocked() const { return m_animatedPropertyLocked; }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 enum IntervalSelector { FirstInterval, NextInterval }; 169 enum IntervalSelector { FirstInterval, NextInterval };
170 170
171 SMILInterval resolveInterval(IntervalSelector) const; 171 SMILInterval resolveInterval(IntervalSelector) const;
172 void resolveFirstInterval(); 172 void resolveFirstInterval();
173 bool resolveNextInterval(); 173 bool resolveNextInterval();
174 SMILTime resolveActiveEnd(SMILTime resolvedBegin, SMILTime resolvedEnd) const; 174 SMILTime resolveActiveEnd(SMILTime resolvedBegin, SMILTime resolvedEnd) const;
175 SMILTime repeatingDuration() const; 175 SMILTime repeatingDuration() const;
176 176
177 enum RestartedInterval { DidNotRestartInterval, DidRestartInterval }; 177 enum RestartedInterval { DidNotRestartInterval, DidRestartInterval };
178 178
179 RestartedInterval maybeRestartInterval(SMILTime elapsed); 179 RestartedInterval maybeRestartInterval(double elapsed);
180 void beginListChanged(SMILTime eventTime); 180 void beginListChanged(SMILTime eventTime);
181 void endListChanged(SMILTime eventTime); 181 void endListChanged(SMILTime eventTime);
182 182
183 // This represents conditions on elements begin or end list that need to be 183 // This represents conditions on elements begin or end list that need to be
184 // resolved on runtime, for example 184 // resolved on runtime, for example
185 // <animate begin="otherElement.begin + 8s; button.click" ... /> 185 // <animate begin="otherElement.begin + 8s; button.click" ... />
186 class Condition : public GarbageCollectedFinalized<Condition> { 186 class Condition : public GarbageCollectedFinalized<Condition> {
187 public: 187 public:
188 enum Type { EventBase, Syncbase, AccessKey }; 188 enum Type { EventBase, Syncbase, AccessKey };
189 189
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 void notifyDependentsIntervalChanged(); 240 void notifyDependentsIntervalChanged();
241 void createInstanceTimesFromSyncbase(SVGSMILElement* syncbase); 241 void createInstanceTimesFromSyncbase(SVGSMILElement* syncbase);
242 void addSyncBaseDependent(SVGSMILElement*); 242 void addSyncBaseDependent(SVGSMILElement*);
243 void removeSyncBaseDependent(SVGSMILElement*); 243 void removeSyncBaseDependent(SVGSMILElement*);
244 244
245 enum ActiveState { Inactive, Active, Frozen }; 245 enum ActiveState { Inactive, Active, Frozen };
246 246
247 QualifiedName m_attributeName; 247 QualifiedName m_attributeName;
248 248
249 ActiveState determineActiveState(SMILTime elapsed) const; 249 ActiveState determineActiveState(SMILTime elapsed) const;
250 float calculateAnimationPercentAndRepeat(SMILTime elapsed, 250 float calculateAnimationPercentAndRepeat(double elapsed,
251 unsigned& repeat) const; 251 unsigned& repeat) const;
252 SMILTime calculateNextProgressTime(SMILTime elapsed) const; 252 SMILTime calculateNextProgressTime(double elapsed) const;
253 253
254 Member<SVGElement> m_targetElement; 254 Member<SVGElement> m_targetElement;
255 255
256 HeapVector<Member<Condition>> m_conditions; 256 HeapVector<Member<Condition>> m_conditions;
257 bool m_syncBaseConditionsConnected; 257 bool m_syncBaseConditionsConnected;
258 bool m_hasEndEventConditions; 258 bool m_hasEndEventConditions;
259 259
260 bool m_isWaitingForFirstInterval; 260 bool m_isWaitingForFirstInterval;
261 bool m_isScheduled; 261 bool m_isScheduled;
262 262
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 element.hasTagName(SVGNames::animateMotionTag) || 300 element.hasTagName(SVGNames::animateMotionTag) ||
301 element.hasTagName(SVGNames::animateTransformTag) || 301 element.hasTagName(SVGNames::animateTransformTag) ||
302 element.hasTagName((SVGNames::discardTag)); 302 element.hasTagName((SVGNames::discardTag));
303 } 303 }
304 304
305 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGSMILElement); 305 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGSMILElement);
306 306
307 } // namespace blink 307 } // namespace blink
308 308
309 #endif // SVGSMILElement_h 309 #endif // SVGSMILElement_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698