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

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

Issue 802143002: AnimationPolicy setting is applied to SVG animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
Index: Source/core/svg/animation/SMILTimeContainer.h
diff --git a/Source/core/svg/animation/SMILTimeContainer.h b/Source/core/svg/animation/SMILTimeContainer.h
index 53565e99e5ecad742066aacc42bab3b10d576271..09bd2f31b4f0527d699bf0cdf3b870f86519b6cf 100644
--- a/Source/core/svg/animation/SMILTimeContainer.h
+++ b/Source/core/svg/animation/SMILTimeContainer.h
@@ -29,6 +29,7 @@
#include "core/dom/QualifiedName.h"
#include "core/svg/animation/SMILTime.h"
#include "platform/Timer.h"
+#include "platform/graphics/ImageAnimationPolicy.h"
#include "platform/heap/Handle.h"
#include "wtf/HashMap.h"
#include "wtf/HashSet.h"
@@ -84,10 +85,24 @@ private:
AnimationFrame
};
+ enum AnimationPolicyOnceAction {
+ // Restart OnceTimer if the timeline is not paused.
+ RestartOnceTimerIfNotPaused,
+ // Restart OnceTimer.
+ RestartOnceTimer,
+ // Cancel OnceTimer.
+ CancelOnceTimer
+ };
+
bool isTimelineRunning() const;
void scheduleAnimationFrame(SMILTime fireTime);
void cancelAnimationFrame();
void wakeupTimerFired(Timer<SMILTimeContainer>*);
+ void scheduleAnimationPolicyTimer();
+ void cancelAnimationPolicyTimer();
+ void animationPolicyTimerFired(Timer<SMILTimeContainer>*);
+ ImageAnimationPolicy animationPolicy() const;
+ bool handleAnimationPolicy(AnimationPolicyOnceAction);
void updateAnimationsAndScheduleFrameIfNeeded(SMILTime elapsed, bool seekToTime = false);
SMILTime updateAnimations(SMILTime elapsed, bool seekToTime = false);
void serviceOnNextFrame();
@@ -110,6 +125,7 @@ private:
bool m_documentOrderIndexesDirty;
Timer<SMILTimeContainer> m_wakeupTimer;
+ Timer<SMILTimeContainer> m_animationPolicyOnceTimer;
using ElementAttributePair = pair<RawPtrWillBeWeakMember<SVGElement>, QualifiedName>;
using AnimationsLinkedHashSet = WillBeHeapLinkedHashSet<RawPtrWillBeWeakMember<SVGSMILElement>>;
« no previous file with comments | « LayoutTests/svg/animations/svg-animation-policy-once-expected.txt ('k') | Source/core/svg/animation/SMILTimeContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698