| 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 28 matching lines...) Expand all Loading... |
| 39 #include <wtf/text/WTFString.h> | 39 #include <wtf/text/WTFString.h> |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 class SVGElement; | 43 class SVGElement; |
| 44 class SVGSMILElement; | 44 class SVGSMILElement; |
| 45 class SVGSVGElement; | 45 class SVGSVGElement; |
| 46 | 46 |
| 47 class SMILTimeContainer : public RefCounted<SMILTimeContainer> { | 47 class SMILTimeContainer : public RefCounted<SMILTimeContainer> { |
| 48 public: | 48 public: |
| 49 static PassRefPtr<SMILTimeContainer> create(SVGSVGElement* owner) { return a
doptRef(new SMILTimeContainer(owner)); } | 49 static PassRefPtr<SMILTimeContainer> create(SVGSVGElement* owner) { return a
doptRef(new SMILTimeContainer(owner)); } |
| 50 ~SMILTimeContainer(); |
| 50 | 51 |
| 51 void schedule(SVGSMILElement*); | 52 void schedule(SVGSMILElement*, SVGElement*, const QualifiedName&); |
| 52 void unschedule(SVGSMILElement*); | 53 void unschedule(SVGSMILElement*, SVGElement*, const QualifiedName&); |
| 53 | 54 void notifyIntervalsChanged(); |
| 55 |
| 54 SMILTime elapsed() const; | 56 SMILTime elapsed() const; |
| 55 | 57 |
| 56 bool isActive() const; | 58 bool isActive() const; |
| 57 bool isPaused() const; | 59 bool isPaused() const; |
| 58 bool isStarted() const; | 60 bool isStarted() const; |
| 59 | 61 |
| 60 void begin(); | 62 void begin(); |
| 61 void pause(); | 63 void pause(); |
| 62 void resume(); | 64 void resume(); |
| 63 void setElapsed(SMILTime); | 65 void setElapsed(SMILTime); |
| 64 | 66 |
| 65 void setDocumentOrderIndexesDirty() { m_documentOrderIndexesDirty = true; } | 67 void setDocumentOrderIndexesDirty() { m_documentOrderIndexesDirty = true; } |
| 66 | 68 |
| 67 private: | 69 private: |
| 68 SMILTimeContainer(SVGSVGElement* owner); | 70 SMILTimeContainer(SVGSVGElement* owner); |
| 69 | 71 |
| 70 void timerFired(Timer<SMILTimeContainer>*); | 72 void timerFired(Timer<SMILTimeContainer>*); |
| 71 void startTimer(SMILTime fireTime, SMILTime minimumDelay = 0); | 73 void startTimer(SMILTime fireTime, SMILTime minimumDelay = 0); |
| 72 void updateAnimations(SMILTime elapsed, bool seekToTime = false); | 74 void updateAnimations(SMILTime elapsed, bool seekToTime = false); |
| 73 | 75 |
| 74 void updateDocumentOrderIndexes(); | 76 void updateDocumentOrderIndexes(); |
| 75 void sortByPriority(Vector<SVGSMILElement*>& smilElements, SMILTime elapsed)
; | 77 void sortByPriority(Vector<SVGSMILElement*>& smilElements, SMILTime elapsed)
; |
| 76 | 78 |
| 77 double m_beginTime; | 79 double m_beginTime; |
| 78 double m_pauseTime; | 80 double m_pauseTime; |
| 79 double m_accumulatedPauseTime; | 81 double m_accumulatedPauseTime; |
| 80 double m_presetStartTime; | 82 double m_presetStartTime; |
| 81 | 83 |
| 82 bool m_documentOrderIndexesDirty; | 84 bool m_documentOrderIndexesDirty; |
| 83 | 85 |
| 84 Timer<SMILTimeContainer> m_timer; | 86 Timer<SMILTimeContainer> m_timer; |
| 85 | 87 |
| 86 typedef HashSet<SVGSMILElement*> TimingElementSet; | 88 typedef pair<SVGElement*, QualifiedName> ElementAttributePair; |
| 87 TimingElementSet m_scheduledAnimations; | 89 typedef Vector<SVGSMILElement*> AnimationsVector; |
| 90 typedef HashMap<ElementAttributePair, AnimationsVector* > GroupedAnimationsM
ap; |
| 91 GroupedAnimationsMap m_scheduledAnimations; |
| 88 | 92 |
| 89 SVGSVGElement* m_ownerSVGElement; | 93 SVGSVGElement* m_ownerSVGElement; |
| 94 |
| 95 #ifndef NDEBUG |
| 96 bool m_preventScheduledAnimationsChanges; |
| 97 #endif |
| 90 }; | 98 }; |
| 91 } | 99 } |
| 92 | 100 |
| 93 #endif // ENABLE(SVG) | 101 #endif // ENABLE(SVG) |
| 94 #endif // SMILTimeContainer_h | 102 #endif // SMILTimeContainer_h |
| OLD | NEW |