summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/svg/animation
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/svg/animation')
-rw-r--r--Source/WebCore/svg/animation/SMILTime.h2
-rw-r--r--Source/WebCore/svg/animation/SMILTimeContainer.cpp14
-rw-r--r--Source/WebCore/svg/animation/SMILTimeContainer.h2
-rw-r--r--Source/WebCore/svg/animation/SVGSMILElement.cpp2
4 files changed, 10 insertions, 10 deletions
diff --git a/Source/WebCore/svg/animation/SMILTime.h b/Source/WebCore/svg/animation/SMILTime.h
index 60d1301a0..3047d97af 100644
--- a/Source/WebCore/svg/animation/SMILTime.h
+++ b/Source/WebCore/svg/animation/SMILTime.h
@@ -31,6 +31,8 @@
namespace WebCore {
+const double SMILAnimationFrameDelay = 1.0 / 60;
+
class SMILTime {
public:
SMILTime() : m_time(0) { }
diff --git a/Source/WebCore/svg/animation/SMILTimeContainer.cpp b/Source/WebCore/svg/animation/SMILTimeContainer.cpp
index 57d9c7f7f..cbf3b7ba5 100644
--- a/Source/WebCore/svg/animation/SMILTimeContainer.cpp
+++ b/Source/WebCore/svg/animation/SMILTimeContainer.cpp
@@ -35,8 +35,6 @@
namespace WebCore {
-static const double animationFrameDelay = 0.025;
-
SMILTimeContainer::SMILTimeContainer(SVGSVGElement* owner)
: m_beginTime(0)
, m_pauseTime(0)
@@ -100,7 +98,7 @@ void SMILTimeContainer::notifyIntervalsChanged()
{
// Schedule updateAnimations() to be called asynchronously so multiple intervals
// can change with updateAnimations() only called once at the end.
- startTimer(0);
+ startTimer(elapsed(), 0);
}
SMILTime SMILTimeContainer::elapsed() const
@@ -161,7 +159,7 @@ void SMILTimeContainer::resume()
m_resumeTime = monotonicallyIncreasingTime();
m_pauseTime = 0;
- startTimer(0);
+ startTimer(elapsed(), 0);
}
void SMILTimeContainer::setElapsed(SMILTime time)
@@ -198,7 +196,7 @@ void SMILTimeContainer::setElapsed(SMILTime time)
updateAnimations(time, true);
}
-void SMILTimeContainer::startTimer(SMILTime fireTime, SMILTime minimumDelay)
+void SMILTimeContainer::startTimer(SMILTime elapsed, SMILTime fireTime, SMILTime minimumDelay)
{
if (!m_beginTime || isPaused())
return;
@@ -206,7 +204,7 @@ void SMILTimeContainer::startTimer(SMILTime fireTime, SMILTime minimumDelay)
if (!fireTime.isFinite())
return;
- SMILTime delay = std::max(fireTime - elapsed(), minimumDelay);
+ SMILTime delay = std::max(fireTime - elapsed, minimumDelay);
m_timer.startOneShot(delay.value());
}
@@ -309,7 +307,7 @@ void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
#ifndef NDEBUG
m_preventScheduledAnimationsChanges = false;
#endif
- startTimer(earliestFireTime, animationFrameDelay);
+ startTimer(elapsed, earliestFireTime, SMILAnimationFrameDelay);
return;
}
@@ -321,7 +319,7 @@ void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
m_preventScheduledAnimationsChanges = false;
#endif
- startTimer(earliestFireTime, animationFrameDelay);
+ startTimer(elapsed, earliestFireTime, SMILAnimationFrameDelay);
}
}
diff --git a/Source/WebCore/svg/animation/SMILTimeContainer.h b/Source/WebCore/svg/animation/SMILTimeContainer.h
index d2856027a..ae4cba4d9 100644
--- a/Source/WebCore/svg/animation/SMILTimeContainer.h
+++ b/Source/WebCore/svg/animation/SMILTimeContainer.h
@@ -67,7 +67,7 @@ private:
SMILTimeContainer(SVGSVGElement* owner);
void timerFired();
- void startTimer(SMILTime fireTime, SMILTime minimumDelay = 0);
+ void startTimer(SMILTime elapsed, SMILTime fireTime, SMILTime minimumDelay = 0);
void updateAnimations(SMILTime elapsed, bool seekToTime = false);
void updateDocumentOrderIndexes();
diff --git a/Source/WebCore/svg/animation/SVGSMILElement.cpp b/Source/WebCore/svg/animation/SVGSMILElement.cpp
index 4410b5bd3..f75f945a5 100644
--- a/Source/WebCore/svg/animation/SVGSMILElement.cpp
+++ b/Source/WebCore/svg/animation/SVGSMILElement.cpp
@@ -1042,7 +1042,7 @@ SMILTime SVGSMILElement::calculateNextProgressTime(SMILTime elapsed) const
return repeatingDurationEnd;
return m_intervalEnd;
}
- return elapsed + 0.025;
+ return elapsed + SMILAnimationFrameDelay;
}
return m_intervalBegin >= elapsed ? m_intervalBegin : SMILTime::unresolved();
}