[iOS] Throttle CSS animations to 30fps in low power mode
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Mar 2017 23:07:50 +0000 (23:07 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Mar 2017 23:07:50 +0000 (23:07 +0000)
commitda9b9016f64e0f1aded788839df7510eca769a43
tree4318082b8fac6a8749329c127fba15005fb8adc0
parentf2ff6936d22c11a90e45e36a5f8172f979b476da
[iOS] Throttle CSS animations to 30fps in low power mode
https://bugs.webkit.org/show_bug.cgi?id=169138
<rdar://problem/30837805>

Reviewed by Said Abou-Hallawa.

Source/WebCore:

Throttle software CSS animations to 30fps in low power mode on iOS
to save battery.

Test: fast/animation/css-animation-throttling-lowPowerMode.html

* page/Page.cpp:
(WebCore::Page::handleLowModePowerChange):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::CSSAnimationControllerPrivate):
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
(WebCore::CSSAnimationControllerPrivate::updateThrottlingState):
(WebCore::CSSAnimationControllerPrivate::animationInterval):
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdate):
(WebCore::CSSAnimationController::updateThrottlingState):
(WebCore::CSSAnimationController::animationInterval):
* page/animation/CSSAnimationController.h:
* page/animation/CSSAnimationControllerPrivate.h:
* testing/Internals.cpp:
(WebCore::Internals::animationsInterval):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Add layout test coverage.

* fast/animation/css-animation-throttling-lowPowerMode-expected.txt: Added.
* fast/animation/css-animation-throttling-lowPowerMode.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/animation/css-animation-throttling-lowPowerMode-expected.txt [new file with mode: 0644]
LayoutTests/fast/animation/css-animation-throttling-lowPowerMode.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/Page.cpp
Source/WebCore/page/animation/CSSAnimationController.cpp
Source/WebCore/page/animation/CSSAnimationController.h
Source/WebCore/page/animation/CSSAnimationControllerPrivate.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl