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

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

Issue 191963002: Use new Traversal<SVG*Element> API more in SVG code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
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 28 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « Source/core/svg/SVGTextPositioningElement.h ('k') | Source/core/svg/animation/SMILTimeContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698