[iOS] Throttle SVG SMIL animations to 30fps in low power mode
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Mar 2017 23:54:48 +0000 (23:54 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Mar 2017 23:54:48 +0000 (23:54 +0000)
commit0583ffdc847792dec4ccbb573ef81034b38928f0
tree50ef6012b177c86964b7fad74aefc7718871532a
parent2abacfda21a6eaecb38e45b46248af67b2b532f4
[iOS] Throttle SVG SMIL animations to 30fps in low power mode
https://bugs.webkit.org/show_bug.cgi?id=169137
<rdar://problem/30833754>

Reviewed by Simon Fraser.

Source/WebCore:

Throttle SVG SMIL animations to 30fps in low power mode on iOS to save
battery.

Test: svg/animations/animations-lowPowerMode-throttling.html

* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::SVGSVGElement):
* svg/SVGSVGElement.idl:
* svg/animation/SMILTime.h:
(WebCore::SMILTime::SMILTime):
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::SMILTimeContainer):
(WebCore::SMILTimeContainer::animationFrameDelay):
(WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
(WebCore::SMILTimeContainer::updateAnimations):
* svg/animation/SMILTimeContainer.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::calculateNextProgressTime):
* testing/Internals.cpp:
(WebCore::Internals::svgAnimationsInterval):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Add layout test coverage.

* svg/animations/animations-lowPowerMode-throttling-expected.txt: Added.
* svg/animations/animations-lowPowerMode-throttling.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/animations/animations-lowPowerMode-throttling-expected.txt [new file with mode: 0644]
LayoutTests/svg/animations/animations-lowPowerMode-throttling.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/svg/SVGSVGElement.idl
Source/WebCore/svg/animation/SMILTime.h
Source/WebCore/svg/animation/SMILTimeContainer.cpp
Source/WebCore/svg/animation/SMILTimeContainer.h
Source/WebCore/svg/animation/SVGSMILElement.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl