Chromium Code Reviews| Index: Source/core/svg/graphics/SVGImageChromeClient.cpp |
| diff --git a/Source/core/svg/graphics/SVGImageChromeClient.cpp b/Source/core/svg/graphics/SVGImageChromeClient.cpp |
| index 5c197ba7fcf80d6b68facd3ac5cd9a9aaf87c28e..290c821eb986a4ccaad5bf1b0fd24e84d55ad9ce 100644 |
| --- a/Source/core/svg/graphics/SVGImageChromeClient.cpp |
| +++ b/Source/core/svg/graphics/SVGImageChromeClient.cpp |
| @@ -35,6 +35,8 @@ |
| namespace WebCore { |
| +static const double animationFrameDelay = 0.025; |
|
dstockwell
2014/03/04 01:19:04
Is this 40hz, why?
fs
2014/03/04 10:28:19
I used the old value from the SVG animations code
|
| + |
| SVGImageChromeClient::SVGImageChromeClient(SVGImage* image) |
| : m_image(image) |
| , m_animationTimer(this, &SVGImageChromeClient::animationTimerFired) |
| @@ -67,7 +69,12 @@ void SVGImageChromeClient::scheduleAnimation() |
| // approach. |
| if (m_animationTimer.isActive()) |
| return; |
| - m_animationTimer.startOneShot(0); |
| + // Schedule the 'animation' ASAP if the image does not contain any |
| + // animations, but prefer a fixed, jittery, frame-delay if there're any |
| + // animations. Checking for pending/active animations could be more |
| + // stringent. |
| + double fireTime = m_image->hasAnimations() ? animationFrameDelay : 0; |
| + m_animationTimer.startOneShot(fireTime); |
| } |
| void SVGImageChromeClient::animationTimerFired(Timer<SVGImageChromeClient>*) |