| 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 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 class AnimationClock; | 41 class AnimationClock; |
| 42 class Document; | 42 class Document; |
| 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 ~SMILTimeContainer(); |
| 51 | 51 |
| 52 void schedule(SVGSMILElement*, SVGElement*, const QualifiedName&); | 52 void schedule(SVGSMILElement*, SVGElement*, const QualifiedName&); |
| 53 void unschedule(SVGSMILElement*, SVGElement*, const QualifiedName&); | 53 void unschedule(SVGSMILElement*, SVGElement*, const QualifiedName&); |
| 54 void notifyIntervalsChanged(); | 54 void notifyIntervalsChanged(); |
| 55 | 55 |
| 56 SMILTime elapsed() const; | 56 SMILTime elapsed() const; |
| 57 | 57 |
| 58 bool isPaused() const; | 58 bool isPaused() const; |
| 59 bool isStarted() const; | 59 bool isStarted() const; |
| 60 | 60 |
| 61 void begin(); | 61 void begin(); |
| 62 void pause(); | 62 void pause(); |
| 63 void resume(); | 63 void resume(); |
| 64 void setElapsed(SMILTime); | 64 void setElapsed(SMILTime); |
| 65 | 65 |
| 66 void serviceAnimations(double monotonicAnimationStartTime); | 66 void serviceAnimations(double monotonicAnimationStartTime); |
| 67 bool hasAnimations() const; | 67 bool hasAnimations() const; |
| 68 | 68 |
| 69 void setDocumentOrderIndexesDirty() { m_documentOrderIndexesDirty = true; } | 69 void setDocumentOrderIndexesDirty() { m_documentOrderIndexesDirty = true; } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 SMILTimeContainer(SVGSVGElement* owner); | 72 SMILTimeContainer(SVGSVGElement& owner); |
| 73 | 73 |
| 74 enum FrameSchedulingState { | 74 enum FrameSchedulingState { |
| 75 // No frame scheduled. | 75 // No frame scheduled. |
| 76 Idle, | 76 Idle, |
| 77 // Scheduled a wakeup to update the animation values. | 77 // Scheduled a wakeup to update the animation values. |
| 78 SynchronizeAnimations, | 78 SynchronizeAnimations, |
| 79 // Scheduled a animation frame for continuous update. | 79 // Scheduled a animation frame for continuous update. |
| 80 AnimationFrame | 80 AnimationFrame |
| 81 }; | 81 }; |
| 82 | 82 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 106 bool m_documentOrderIndexesDirty; | 106 bool m_documentOrderIndexesDirty; |
| 107 | 107 |
| 108 OwnPtr<AnimationClock> m_animationClock; | 108 OwnPtr<AnimationClock> m_animationClock; |
| 109 Timer<SMILTimeContainer> m_wakeupTimer; | 109 Timer<SMILTimeContainer> m_wakeupTimer; |
| 110 | 110 |
| 111 typedef pair<SVGElement*, QualifiedName> ElementAttributePair; | 111 typedef pair<SVGElement*, QualifiedName> ElementAttributePair; |
| 112 typedef Vector<SVGSMILElement*> AnimationsVector; | 112 typedef Vector<SVGSMILElement*> AnimationsVector; |
| 113 typedef HashMap<ElementAttributePair, OwnPtr<AnimationsVector> > GroupedAnim
ationsMap; | 113 typedef HashMap<ElementAttributePair, OwnPtr<AnimationsVector> > GroupedAnim
ationsMap; |
| 114 GroupedAnimationsMap m_scheduledAnimations; | 114 GroupedAnimationsMap m_scheduledAnimations; |
| 115 | 115 |
| 116 SVGSVGElement* m_ownerSVGElement; | 116 SVGSVGElement& m_ownerSVGElement; |
| 117 | 117 |
| 118 #ifndef NDEBUG | 118 #ifndef NDEBUG |
| 119 bool m_preventScheduledAnimationsChanges; | 119 bool m_preventScheduledAnimationsChanges; |
| 120 #endif | 120 #endif |
| 121 }; | 121 }; |
| 122 } | 122 } |
| 123 | 123 |
| 124 #endif // SMILTimeContainer_h | 124 #endif // SMILTimeContainer_h |
| OLD | NEW |