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

Unified Diff: Source/core/svg/animation/SMILTimeContainer.h

Issue 190963003: Drive SVG Animations via requestAnimationFrame (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/SVGDocumentExtensions.cpp ('k') | Source/core/svg/animation/SMILTimeContainer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/animation/SMILTimeContainer.h
diff --git a/Source/core/svg/animation/SMILTimeContainer.h b/Source/core/svg/animation/SMILTimeContainer.h
index bff4ae935b6faaa287b39e1d2914ee0559c475e8..28fd8fb41d50b771b74183d0f9846f450d31788e 100644
--- a/Source/core/svg/animation/SMILTimeContainer.h
+++ b/Source/core/svg/animation/SMILTimeContainer.h
@@ -38,6 +38,8 @@
namespace WebCore {
+class AnimationClock;
+class Document;
class SVGElement;
class SVGSMILElement;
class SVGSVGElement;
@@ -61,30 +63,50 @@ public:
void resume();
void setElapsed(SMILTime);
+ void serviceAnimations(double monotonicAnimationStartTime);
+ bool hasAnimations() const;
+
void setDocumentOrderIndexesDirty() { m_documentOrderIndexesDirty = true; }
private:
SMILTimeContainer(SVGSVGElement* owner);
+ enum FrameSchedulingState {
+ // No frame scheduled.
+ Idle,
+ // Scheduled a wakeup to update the animation values.
+ SynchronizeAnimations,
+ // Scheduled a animation frame for continuous update.
+ AnimationFrame
+ };
+
bool isTimelineRunning() const;
void scheduleAnimationFrame(SMILTime fireTime);
- void scheduleAnimationFrame();
void cancelAnimationFrame();
- void timerFired(Timer<SMILTimeContainer>*);
- void updateAnimations(SMILTime elapsed, bool seekToTime = false);
+ void wakeupTimerFired(Timer<SMILTimeContainer>*);
+ void updateAnimationsAndScheduleFrameIfNeeded(SMILTime elapsed, bool seekToTime = false);
+ SMILTime updateAnimations(SMILTime elapsed, bool seekToTime = false);
+ void serviceOnNextFrame();
+ void scheduleWakeUp(double delayTime, FrameSchedulingState);
void updateDocumentOrderIndexes();
double lastResumeTime() const { return m_resumeTime ? m_resumeTime : m_beginTime; }
+ Document& document() const;
+ AnimationClock& animationClock() const;
+ double currentTime() const;
+
double m_beginTime;
double m_pauseTime;
double m_resumeTime;
double m_accumulatedActiveTime;
double m_presetStartTime;
+ FrameSchedulingState m_frameSchedulingState;
bool m_documentOrderIndexesDirty;
- Timer<SMILTimeContainer> m_timer;
+ OwnPtr<AnimationClock> m_animationClock;
+ Timer<SMILTimeContainer> m_wakeupTimer;
typedef pair<SVGElement*, QualifiedName> ElementAttributePair;
typedef Vector<SVGSMILElement*> AnimationsVector;
« no previous file with comments | « Source/core/svg/SVGDocumentExtensions.cpp ('k') | Source/core/svg/animation/SMILTimeContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698