[UI-side compositing] Fix copying animations between layers, and pausing them
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 May 2014 17:48:33 +0000 (17:48 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 May 2014 17:48:33 +0000 (17:48 +0000)
commitf84f4c9107fd332327b6298d20d60fa8fd5e0d36
tree96c45549c8643e70265a5555da56625a4a2a4bf8
parent13efbcf448e9a8d67213aa6f3fd1c9e9877c3bc6
[UI-side compositing] Fix copying animations between layers, and pausing them
https://bugs.webkit.org/show_bug.cgi?id=132943
<rdar://problem/16906369&16906541>

Reviewed by Tim Horton.

Source/WebCore:

Pass the animation key back to animationStarted(), though this isn't used
when animations are running in-process.

* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(-[WebAnimationDelegate animationDidStart:]):
(PlatformCALayerMac::animationStarted):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::animationStarted):
* platform/graphics/ca/win/PlatformCALayerWin.h:

Source/WebKit2:

Fix PlatformCAAnimationRemote to support animation copying, and to record
the beginTime for implicitly started animations. This fixes animation pausing,
and copying of animations between layers when they go between tiled and non-tiled.

This requires sending the animation key back through animationDidStart() so that
we can record this beginTime on the PlatformCAAnimationRemote in the web process.
This path doesn't set the "hasExplicitBeginTime" flag.

PlatformCAAnimationRemote also now stores a hash of active animations, so that
it can implement animationForKey(), and record the beginTime.

* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::animationDidStart): Grovel for the key for this
animation; sadly CA doesn't give us an easier way.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::acceleratedAnimationDidStart):
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
(-[WKAnimationDelegate animationDidStart:]):
(WebKit::PlatformCAAnimationRemote::copy):
(WebKit::PlatformCAAnimationRemote::copyTimingFunctionFrom):
(WebKit::PlatformCAAnimationRemote::copyFromValueFrom):
(WebKit::PlatformCAAnimationRemote::copyToValueFrom):
(WebKit::PlatformCAAnimationRemote::copyValuesFrom):
(WebKit::PlatformCAAnimationRemote::copyKeyTimesFrom):
(WebKit::PlatformCAAnimationRemote::copyTimingFunctionsFrom):
(WebKit::addAnimationToLayer):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::addAnimationForKey):
(WebKit::PlatformCALayerRemote::removeAnimationForKey):
(WebKit::PlatformCALayerRemote::animationForKey):
(WebKit::PlatformCALayerRemote::animationStarted):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::animationDidStart):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/PlatformCALayer.h
Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm
Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h
Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h
Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm
Source/WebKit2/WebProcess/WebPage/DrawingArea.h
Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.h
Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm