[chromium] Animation events should only be used for synchronizing animation start...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 12:13:36 +0000 (12:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 12:13:36 +0000 (12:13 +0000)
commitc74331913ea4f8d11d0cdd0a7b573eef34323029
tree4d955cf4eda3be64ace6006f26010a242b2bd1d8
parentbae4392a041b4fef4e4981b3a1fdc278729b573d
[chromium] Animation events should only be used for synchronizing animation start times
https://bugs.webkit.org/show_bug.cgi?id=81484

Patch by Ian Vollick <vollick@chromium.org> on 2012-03-21
Reviewed by Adrienne Walker.

Source/WebCore:

Tested in CCLayerTreeHostTestSynchronizeAnimationStartTimes

Eliminated animation finished events. Animations will finish naturally on the
main thread and the final values will be set.

Animation started events are now also used to synchronize the main thread
animations' start times with their impl thread equivalents, preventing skew.
Until main thread animations receive their synchronized start times, they will
apply their initial values (i.e., they will be paused at time zero). This
guarantees that we will not jump to the animation's final value on the main
thread while we wait for the synchronized start time.

* WebCore.gypi:
* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::notifyAnimationStarted):
* platform/graphics/chromium/LayerChromium.h:
(WebCore):
(LayerChromium):
* platform/graphics/chromium/cc/CCActiveAnimation.cpp:
(WebCore::CCActiveAnimation::CCActiveAnimation):
* platform/graphics/chromium/cc/CCActiveAnimation.h:
(CCActiveAnimation):
(WebCore::CCActiveAnimation::needsSynchronizedStartTime):
(WebCore::CCActiveAnimation::setNeedsSynchronizedStartTime):
* platform/graphics/chromium/cc/CCAnimationEvents.cpp: Removed.
* platform/graphics/chromium/cc/CCAnimationEvents.h:
(WebCore::CCAnimationStartedEvent::CCAnimationStartedEvent):
(CCAnimationStartedEvent):
(WebCore):
* platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
(WebCore::CCLayerAnimationController::animate):
(WebCore::CCLayerAnimationController::notifyAnimationStarted):
(WebCore):
(WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread):
(WebCore::CCLayerAnimationController::startAnimationsWaitingForNextTick):
(WebCore::CCLayerAnimationController::startAnimationsWaitingForStartTime):
(WebCore::CCLayerAnimationController::startAnimationsWaitingForTargetAvailability):
(WebCore::CCLayerAnimationController::purgeFinishedAnimations):
(WebCore::CCLayerAnimationController::tickAnimations):
* platform/graphics/chromium/cc/CCLayerAnimationController.h:
(CCLayerAnimationController):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::updateAnimations):
(WebCore::CCLayerTreeHost::setAnimationEventsRecursive):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(CCLayerTreeHost):

Source/WebKit/chromium:

* tests/CCLayerTreeHostTest.cpp:
(WTF):
(CCLayerTreeHostTestSynchronizeAnimationStartTimes):
(WTF::CCLayerTreeHostTestSynchronizeAnimationStartTimes::CCLayerTreeHostTestSynchronizeAnimationStartTimes):
(WTF::CCLayerTreeHostTestSynchronizeAnimationStartTimes::beginTest):
(WTF::CCLayerTreeHostTestSynchronizeAnimationStartTimes::animateLayers):
(WTF::CCLayerTreeHostTestSynchronizeAnimationStartTimes::afterTest):
(WTF::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111525 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.cpp
Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.h
Source/WebCore/platform/graphics/chromium/cc/CCAnimationEvents.cpp [deleted file]
Source/WebCore/platform/graphics/chromium/cc/CCAnimationEvents.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp