<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[172836] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/172836">172836</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-08-21 15:43:18 -0700 (Thu, 21 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add animationDidEnd callbacks on GraphicsLayer
https://bugs.webkit.org/show_bug.cgi?id=136084

Reviewed by Tim Horton.

Hook up GraphicsLayerClient::notifyAnimationEnded() so that code using GraphicsLayers directly
can add animations, and know when they finish.

Source/WebCore:

* WebCore.exp.in:
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::notifyAnimationStarted):
(WebCore::GraphicsLayerClient::notifyAnimationEnded):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
(WebCore::GraphicsLayerCA::platformCALayerAnimationEnded):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerAnimationStarted):
(WebCore::PlatformCALayerClient::platformCALayerAnimationEnded):
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(-[WebAnimationDelegate animationDidStart:]):
(-[WebAnimationDelegate animationDidStop:finished:]):
(PlatformCALayerMac::animationStarted):
(PlatformCALayerMac::animationEnded):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::notifyAnimationStarted):
* rendering/RenderLayerBacking.h:

Source/WebKit2:

* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::animationDidEnd):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::acceleratedAnimationDidEnd):
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
(-[WKAnimationDelegate animationDidStop:finished:]):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::animationStarted):
(WebKit::PlatformCALayerRemote::animationEnded):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
(WebKit::RemoteLayerTreeContext::willStartAnimationOnLayer):
(WebKit::RemoteLayerTreeContext::animationDidStart):
(WebKit::RemoteLayerTreeContext::animationDidEnd):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidEnd):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayerClienth">trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCALayerh">trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCALayerClienth">trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMach">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWincpp">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinh">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMappercpp">trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapcoordinatedCompositingCoordinatorcpp">trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapcoordinatedCompositingCoordinatorh">trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapcoordinatedCoordinatedGraphicsLayercpp">trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingh">trunk/Source/WebCore/rendering/RenderLayerBacking.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacRemoteLayerTreeDrawingAreaProxyh">trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacRemoteLayerTreeDrawingAreaProxymm">trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacRemoteLayerTreeHosth">trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacRemoteLayerTreeHostmm">trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreamessagesin">trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCAAnimationRemotemm">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemotecpp">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteh">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeContexth">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeContextmm">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/ChangeLog        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2014-08-21  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Add animationDidEnd callbacks on GraphicsLayer
+        https://bugs.webkit.org/show_bug.cgi?id=136084
+
+        Reviewed by Tim Horton.
+
+        Hook up GraphicsLayerClient::notifyAnimationEnded() so that code using GraphicsLayers directly
+        can add animations, and know when they finish.
+
+        * WebCore.exp.in:
+        * platform/graphics/GraphicsLayerClient.h:
+        (WebCore::GraphicsLayerClient::notifyAnimationStarted):
+        (WebCore::GraphicsLayerClient::notifyAnimationEnded):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
+        (WebCore::GraphicsLayerCA::platformCALayerAnimationEnded):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        * platform/graphics/ca/PlatformCALayer.h:
+        * platform/graphics/ca/PlatformCALayerClient.h:
+        (WebCore::PlatformCALayerClient::platformCALayerAnimationStarted):
+        (WebCore::PlatformCALayerClient::platformCALayerAnimationEnded):
+        * platform/graphics/ca/mac/PlatformCALayerMac.h:
+        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+        (-[WebAnimationDelegate animationDidStart:]):
+        (-[WebAnimationDelegate animationDidStop:finished:]):
+        (PlatformCALayerMac::animationStarted):
+        (PlatformCALayerMac::animationEnded):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::notifyAnimationStarted):
+        * rendering/RenderLayerBacking.h:
+
</ins><span class="cx"> 2014-08-21  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Enable SATURATED_LAYOUT_ARITHMETIC.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -597,8 +597,9 @@
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA23setContentsToSolidColorERKNS_5ColorE
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA23setDebugBackgroundColorERKNS_5ColorE
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA28platformCALayerPaintContentsEPNS_15PlatformCALayerERNS_15GraphicsContextERKNS_9FloatRectE
</span><ins>+__ZN7WebCore15GraphicsLayerCA29platformCALayerAnimationEndedERKN3WTF6StringE
</ins><span class="cx"> __ZN7WebCore15GraphicsLayerCA30deviceOrPageScaleFactorChangedEv
</span><del>-__ZN7WebCore15GraphicsLayerCA31platformCALayerAnimationStartedEd
</del><ins>+__ZN7WebCore15GraphicsLayerCA31platformCALayerAnimationStartedERKN3WTF6StringEd
</ins><span class="cx"> __ZN7WebCore15GraphicsLayerCA37flushCompositingStateForThisLayerOnlyEv
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA40platformCALayerSetNeedsToRevalidateTilesEv
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA7setNameERKN3WTF6StringE
</span><span class="lines">@@ -2058,6 +2059,8 @@
</span><span class="cx"> __ZTVN7WebCore28InspectorFrontendClientLocal8SettingsE
</span><span class="cx"> __ZTVN7WebCore31BasicColorMatrixFilterOperationE
</span><span class="cx"> __ZTVN7WebCore37BasicComponentTransferFilterOperationE
</span><ins>+__ZThn504_N7WebCore15GraphicsLayerCA29platformCALayerAnimationEndedERKN3WTF6StringE
+__ZThn504_N7WebCore15GraphicsLayerCA31platformCALayerAnimationStartedERKN3WTF6StringEd
</ins><span class="cx"> __ZThn???_N7WebCore15GraphicsLayerCA28platformCALayerPaintContentsEPNS_15PlatformCALayerERNS_15GraphicsContextERKNS_9FloatRectE
</span><span class="cx"> __ZThn???_N7WebCore15GraphicsLayerCA31platformCALayerAnimationStartedEd
</span><span class="cx"> __ZThn???_N7WebCore15GraphicsLayerCA40platformCALayerSetNeedsToRevalidateTilesEv
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayerClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -62,7 +62,8 @@
</span><span class="cx">     virtual void tiledBackingUsageChanged(const GraphicsLayer*, bool /*usingTiledBacking*/) { }
</span><span class="cx">     
</span><span class="cx">     // Callback for when hardware-accelerated animation started.
</span><del>-    virtual void notifyAnimationStarted(const GraphicsLayer*, double /*time*/) { }
</del><ins>+    virtual void notifyAnimationStarted(const GraphicsLayer*, const String&amp; /*animationKey*/, double /*time*/) { }
+    virtual void notifyAnimationEnded(const GraphicsLayer*, const String&amp; /*animationKey*/) { }
</ins><span class="cx"> 
</span><span class="cx">     // Notification that a layer property changed that requires a subsequent call to flushCompositingState()
</span><span class="cx">     // to appear on the screen.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -843,11 +843,16 @@
</span><span class="cx">     noteLayerPropertyChanged(AnimationChanged);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void GraphicsLayerCA::platformCALayerAnimationStarted(CFTimeInterval startTime)
</del><ins>+void GraphicsLayerCA::platformCALayerAnimationStarted(const String&amp; animationKey, CFTimeInterval startTime)
</ins><span class="cx"> {
</span><del>-    client().notifyAnimationStarted(this, startTime);
</del><ins>+    client().notifyAnimationStarted(this, animationKey, startTime);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void GraphicsLayerCA::platformCALayerAnimationEnded(const String&amp; animationKey)
+{
+    client().notifyAnimationEnded(this, animationKey);
+}
+
</ins><span class="cx"> void GraphicsLayerCA::setContentsToSolidColor(const Color&amp; color)
</span><span class="cx"> {
</span><span class="cx">     if (color == m_contentsSolidColor)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -179,7 +179,8 @@
</span><span class="cx">     virtual void platformCALayerLayoutSublayersOfLayer(PlatformCALayer*) override { }
</span><span class="cx">     virtual bool platformCALayerRespondsToLayoutChanges() const override { return false; }
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) override;
</del><ins>+    WEBCORE_EXPORT void platformCALayerAnimationStarted(const String&amp; animationKey, CFTimeInterval beginTime) override;
+    WEBCORE_EXPORT void platformCALayerAnimationEnded(const String&amp; animationKey) override;
</ins><span class="cx">     virtual CompositingCoordinatesOrientation platformCALayerContentsOrientation() const override { return contentsOrientation(); }
</span><span class="cx">     WEBCORE_EXPORT virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&amp;, const FloatRect&amp; clip) override;
</span><span class="cx">     virtual bool platformCALayerShowDebugBorders() const override { return isShowingDebugBorder(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCALayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -102,6 +102,7 @@
</span><span class="cx">     virtual void setOwner(PlatformCALayerClient* owner) { m_owner = owner; }
</span><span class="cx"> 
</span><span class="cx">     virtual void animationStarted(const String&amp; key, CFTimeInterval beginTime) = 0;
</span><ins>+    virtual void animationEnded(const String&amp; key) = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual void setNeedsDisplay() = 0;
</span><span class="cx">     virtual void setNeedsDisplayInRect(const FloatRect&amp; dirtyRect) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCALayerClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -39,7 +39,8 @@
</span><span class="cx">     virtual void platformCALayerLayoutSublayersOfLayer(PlatformCALayer*) { }
</span><span class="cx">     virtual bool platformCALayerRespondsToLayoutChanges() const { return false; }
</span><span class="cx"> 
</span><del>-    virtual void platformCALayerAnimationStarted(CFTimeInterval) { }
</del><ins>+    virtual void platformCALayerAnimationStarted(const String&amp; /*animationKey*/, CFTimeInterval) { }
+    virtual void platformCALayerAnimationEnded(const String&amp; /*animationKey*/) { }
</ins><span class="cx">     virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesTopDown; }
</span><span class="cx">     virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&amp;, const FloatRect&amp; inClip) = 0;
</span><span class="cx">     virtual bool platformCALayerShowDebugBorders() const { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx">     virtual void removeAnimationForKey(const String&amp; key) override;
</span><span class="cx">     virtual PassRefPtr&lt;PlatformCAAnimation&gt; animationForKey(const String&amp; key) override;
</span><span class="cx">     virtual void animationStarted(const String&amp; key, CFTimeInterval beginTime) override;
</span><ins>+    virtual void animationEnded(const String&amp; key) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void setMask(PlatformCALayer*) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -114,6 +114,9 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     WebThreadLock();
</span><span class="cx"> #endif
</span><ins>+    if (!m_owner)
+        return;
+
</ins><span class="cx">     CFTimeInterval startTime;
</span><span class="cx">     if (hasExplicitBeginTime(animation)) {
</span><span class="cx">         // We don't know what time CA used to commit the animation, so just use the current time
</span><span class="lines">@@ -122,20 +125,42 @@
</span><span class="cx">     } else
</span><span class="cx">         startTime = mediaTimeToCurrentTime([animation beginTime]);
</span><span class="cx"> 
</span><del>-    if (m_owner) {
-        CALayer *layer = m_owner-&gt;platformLayer();
</del><ins>+    CALayer *layer = m_owner-&gt;platformLayer();
</ins><span class="cx"> 
</span><del>-        String animationKey;
-        for (NSString *key in [layer animationKeys]) {
-            if ([layer animationForKey:key] == animation) {
-                animationKey = key;
-                break;
-            }
</del><ins>+    String animationKey;
+    for (NSString *key in [layer animationKeys]) {
+        if ([layer animationForKey:key] == animation) {
+            animationKey = key;
+            break;
</ins><span class="cx">         }
</span><ins>+    }
</ins><span class="cx"> 
</span><del>-        if (!animationKey.isEmpty())
-            m_owner-&gt;animationStarted(animationKey, startTime);
</del><ins>+    if (!animationKey.isEmpty())
+        m_owner-&gt;animationStarted(animationKey, startTime);
+}
+
+- (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)finished
+{
+#if PLATFORM(IOS)
+    WebThreadLock();
+#endif
+    UNUSED_PARAM(finished);
+
+    if (!m_owner)
+        return;
+    
+    CALayer *layer = m_owner-&gt;platformLayer();
+
+    String animationKey;
+    for (NSString *key in [layer animationKeys]) {
+        if ([layer animationForKey:key] == animation) {
+            animationKey = key;
+            break;
+        }
</ins><span class="cx">     }
</span><ins>+
+    if (!animationKey.isEmpty())
+        m_owner-&gt;animationEnded(animationKey);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setOwner:(PlatformCALayer*)owner
</span><span class="lines">@@ -325,12 +350,18 @@
</span><span class="cx">         [static_cast&lt;WebTiledBackingLayer *&gt;(m_layer.get()) invalidate];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerMac::animationStarted(const String&amp;, CFTimeInterval beginTime)
</del><ins>+void PlatformCALayerMac::animationStarted(const String&amp; animationKey, CFTimeInterval beginTime)
</ins><span class="cx"> {
</span><span class="cx">     if (m_owner)
</span><del>-        m_owner-&gt;platformCALayerAnimationStarted(beginTime);
</del><ins>+        m_owner-&gt;platformCALayerAnimationStarted(animationKey, beginTime);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PlatformCALayerMac::animationEnded(const String&amp; animationKey)
+{
+    if (m_owner)
+        m_owner-&gt;platformCALayerAnimationEnded(animationKey);
+}
+
</ins><span class="cx"> void PlatformCALayerMac::setNeedsDisplay()
</span><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx">     return host ? host-&gt;rootLayer() : 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerWin::animationStarted(const String&amp;, CFTimeInterval beginTime)
</del><ins>+void PlatformCALayerWin::animationStarted(const String&amp; animationKey, CFTimeInterval beginTime)
</ins><span class="cx"> {
</span><span class="cx">     // Update start time for any animation not yet started
</span><span class="cx">     CFTimeInterval cacfBeginTime = currentTimeToMediaTime(beginTime);
</span><span class="lines">@@ -205,9 +205,15 @@
</span><span class="cx">         it-&gt;value-&gt;setActualStartTimeIfNeeded(cacfBeginTime);
</span><span class="cx"> 
</span><span class="cx">     if (m_owner)
</span><del>-        m_owner-&gt;platformCALayerAnimationStarted(beginTime);
</del><ins>+        m_owner-&gt;platformCALayerAnimationStarted(animationKey, beginTime);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PlatformCALayerWin::animationEnded(const String&amp; animationKey)
+{
+    if (m_owner)
+        m_owner-&gt;platformCALayerAnimationEnded(animationKey);
+}
+
</ins><span class="cx"> void PlatformCALayerWin::setNeedsDisplayInRect(const FloatRect&amp; dirtyRect)
</span><span class="cx"> {
</span><span class="cx">     intern(this)-&gt;setNeedsDisplayInRect(dirtyRect);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx">     virtual void removeAnimationForKey(const String&amp; key) override;
</span><span class="cx">     virtual PassRefPtr&lt;PlatformCAAnimation&gt; animationForKey(const String&amp; key) override;
</span><span class="cx">     virtual void animationStarted(const String&amp; key, CFTimeInterval beginTime) override;
</span><ins>+    virtual void animationEnded(const String&amp; key) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void setMask(PlatformCALayer*) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMappercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -558,7 +558,7 @@
</span><span class="cx">         m_layer-&gt;setAnimations(m_animations);
</span><span class="cx"> 
</span><span class="cx">     if (m_changeMask &amp; AnimationStarted)
</span><del>-        client().notifyAnimationStarted(this, m_animationStartTime);
</del><ins>+        client().notifyAnimationStarted(this, &quot;&quot;, m_animationStartTime);
</ins><span class="cx"> 
</span><span class="cx">     if (m_changeMask &amp; FixedToViewporChange)
</span><span class="cx">         m_layer-&gt;setFixedToViewport(fixedToViewport());
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapcoordinatedCompositingCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -239,7 +239,7 @@
</span><span class="cx">         imageBacking-&gt;update();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CompositingCoordinator::notifyAnimationStarted(const GraphicsLayer*, double /* time */)
</del><ins>+void CompositingCoordinator::notifyAnimationStarted(const GraphicsLayer*, const String&amp;, double /* time */)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapcoordinatedCompositingCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     // GraphicsLayerClient
</span><del>-    virtual void notifyAnimationStarted(const GraphicsLayer*, double time) override;
</del><ins>+    virtual void notifyAnimationStarted(const GraphicsLayer*, const String&amp;, double time) override;
</ins><span class="cx">     virtual void notifyFlushRequired(const GraphicsLayer*) override;
</span><span class="cx">     virtual void paintContents(const GraphicsLayer*, GraphicsContext&amp;, GraphicsLayerPaintingPhase, const FloatRect&amp; clipRect) override;
</span><span class="cx">     virtual float deviceScaleFactor() const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapcoordinatedCoordinatedGraphicsLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -1226,7 +1226,7 @@
</span><span class="cx"> 
</span><span class="cx"> void CoordinatedGraphicsLayer::animationStartedTimerFired(Timer&lt;CoordinatedGraphicsLayer&gt;*)
</span><span class="cx"> {
</span><del>-    client().notifyAnimationStarted(this, m_lastAnimationStartTime);
</del><ins>+    client().notifyAnimationStarted(this, &quot;&quot;, m_lastAnimationStartTime);
</ins><span class="cx"> }
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> #endif // USE(COORDINATED_GRAPHICS)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -2460,7 +2460,7 @@
</span><span class="cx">         m_graphicsLayer-&gt;removeAnimation(GraphicsLayer::animationNameForTransition(animatedProperty));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderLayerBacking::notifyAnimationStarted(const GraphicsLayer*, double time)
</del><ins>+void RenderLayerBacking::notifyAnimationStarted(const GraphicsLayer*, const String&amp;, double time)
</ins><span class="cx"> {
</span><span class="cx">     renderer().animation().notifyAnimationStarted(&amp;renderer(), time);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx">     // GraphicsLayerClient interface
</span><span class="cx">     virtual bool shouldUseTiledBacking(const GraphicsLayer*) const override;
</span><span class="cx">     virtual void tiledBackingUsageChanged(const GraphicsLayer*, bool /*usingTiledBacking*/) override;
</span><del>-    virtual void notifyAnimationStarted(const GraphicsLayer*, double startTime) override;
</del><ins>+    virtual void notifyAnimationStarted(const GraphicsLayer*, const String&amp; animationKey, double startTime) override;
</ins><span class="cx">     virtual void notifyFlushRequired(const GraphicsLayer*) override;
</span><span class="cx">     virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/ChangeLog        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2014-08-21  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Add animationDidEnd callbacks on GraphicsLayer
+        https://bugs.webkit.org/show_bug.cgi?id=136084
+
+        Reviewed by Tim Horton.
+
+        Hook up GraphicsLayerClient::notifyAnimationEnded() so that code using GraphicsLayers directly
+        can add animations, and know when they finish.
+
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
+        * UIProcess/mac/RemoteLayerTreeHost.h:
+        * UIProcess/mac/RemoteLayerTreeHost.mm:
+        (WebKit::RemoteLayerTreeHost::animationDidEnd):
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit::DrawingArea::acceleratedAnimationDidEnd):
+        * WebProcess/WebPage/DrawingArea.messages.in:
+        * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
+        (-[WKAnimationDelegate animationDidStop:finished:]):
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+        (WebKit::PlatformCALayerRemote::animationStarted):
+        (WebKit::PlatformCALayerRemote::animationEnded):
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
+        (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
+        (WebKit::RemoteLayerTreeContext::willStartAnimationOnLayer):
+        (WebKit::RemoteLayerTreeContext::animationDidStart):
+        (WebKit::RemoteLayerTreeContext::animationDidEnd):
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidEnd):
+
</ins><span class="cx"> 2014-08-21  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Enable SATURATED_LAYOUT_ARITHMETIC.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacRemoteLayerTreeDrawingAreaProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx">     const RemoteLayerTreeHost&amp; remoteLayerTreeHost() const { return m_remoteLayerTreeHost; }
</span><span class="cx"> 
</span><span class="cx">     void acceleratedAnimationDidStart(uint64_t layerID, const String&amp; key, double startTime);
</span><ins>+    void acceleratedAnimationDidEnd(uint64_t layerID, const String&amp; key);
</ins><span class="cx"> 
</span><span class="cx">     uint64_t nextLayerTreeTransactionID() const { return m_pendingLayerTreeTransactionID + 1; }
</span><span class="cx">     uint64_t lastCommittedLayerTreeTransactionID() const { return m_transactionIDForPendingCACommit; }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacRemoteLayerTreeDrawingAreaProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -241,6 +241,11 @@
</span><span class="cx">     m_webPageProxy-&gt;process().send(Messages::DrawingArea::AcceleratedAnimationDidStart(layerID, key, startTime), m_webPageProxy-&gt;pageID());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd(uint64_t layerID, const String&amp; key)
+{
+    m_webPageProxy-&gt;process().send(Messages::DrawingArea::AcceleratedAnimationDidEnd(layerID, key), m_webPageProxy-&gt;pageID());
+}
+
</ins><span class="cx"> static const float indicatorInset = 10;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacRemoteLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx">     LayerAnimationDelegateMap&amp; animationDelegates() { return m_animationDelegates; }
</span><span class="cx"> 
</span><span class="cx">     void animationDidStart(WebCore::GraphicsLayer::PlatformLayerID, CAAnimation *, double startTime);
</span><ins>+    void animationDidEnd(WebCore::GraphicsLayer::PlatformLayerID, CAAnimation *);
</ins><span class="cx"> 
</span><span class="cx">     void clearLayers();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacRemoteLayerTreeHostmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -152,6 +152,25 @@
</span><span class="cx">         m_drawingArea.acceleratedAnimationDidStart(layerID, animationKey, startTime);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RemoteLayerTreeHost::animationDidEnd(WebCore::GraphicsLayer::PlatformLayerID layerID, CAAnimation *animation)
+{
+    CALayer *layer = asLayer(getLayer(layerID));
+    if (!layer)
+        return;
+
+    String animationKey;
+    for (NSString *key in [layer animationKeys]) {
+        if ([layer animationForKey:key] == animation) {
+            animationKey = key;
+            break;
+        }
+    }
+
+    if (!animationKey.isEmpty())
+        m_drawingArea.acceleratedAnimationDidEnd(layerID, animationKey);
+
+}
+
</ins><span class="cx"> void RemoteLayerTreeHost::clearLayers()
</span><span class="cx"> {
</span><span class="cx">     for (auto&amp; idLayer : m_layers) {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -88,6 +88,7 @@
</span><span class="cx">     virtual void setExposedRect(const WebCore::FloatRect&amp;) = 0;
</span><span class="cx">     virtual WebCore::FloatRect exposedRect() const = 0;
</span><span class="cx">     virtual void acceleratedAnimationDidStart(uint64_t /*layerID*/, const String&amp; /*key*/, double /*startTime*/) { }
</span><ins>+    virtual void acceleratedAnimationDidEnd(uint64_t /*layerID*/, const String&amp; /*key*/) { }
</ins><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     virtual void setExposedContentRect(const WebCore::FloatRect&amp;) = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreamessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx">     CommitTransientZoom(double scale, WebCore::FloatPoint origin)
</span><span class="cx">     
</span><span class="cx">     AcceleratedAnimationDidStart(uint64_t layerID, String key, double startTime)
</span><ins>+    AcceleratedAnimationDidEnd(uint64_t layerID, String key)
</ins><span class="cx">     
</span><span class="cx">     AddTransactionCallbackID(uint64_t callbackID)
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCAAnimationRemotemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -81,6 +81,12 @@
</span><span class="cx"> 
</span><span class="cx">     _layerTreeHost-&gt;animationDidStart(_layerID, animation, startTime);
</span><span class="cx"> }
</span><ins>+
+- (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)finished
+{
+    _layerTreeHost-&gt;animationDidEnd(_layerID, animation);
+}
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemotecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -369,9 +369,15 @@
</span><span class="cx">         toPlatformCAAnimationRemote(it-&gt;value.get())-&gt;didStart(beginTime);
</span><span class="cx">     
</span><span class="cx">     if (m_owner)
</span><del>-        m_owner-&gt;platformCALayerAnimationStarted(beginTime);
</del><ins>+        m_owner-&gt;platformCALayerAnimationStarted(key, beginTime);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PlatformCALayerRemote::animationEnded(const String&amp; key)
+{
+    if (m_owner)
+        m_owner-&gt;platformCALayerAnimationEnded(key);
+}
+
</ins><span class="cx"> void PlatformCALayerRemote::setMask(PlatformCALayer* layer)
</span><span class="cx"> {
</span><span class="cx">     if (layer) {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx">     virtual void removeAnimationForKey(const String&amp; key) override;
</span><span class="cx">     virtual PassRefPtr&lt;WebCore::PlatformCAAnimation&gt; animationForKey(const String&amp; key) override;
</span><span class="cx">     virtual void animationStarted(const String&amp; key, CFTimeInterval beginTime) override;
</span><ins>+    virtual void animationEnded(const String&amp; key) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void setMask(WebCore::PlatformCALayer*) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> 
</span><span class="cx">     // From the UI process
</span><span class="cx">     void animationDidStart(WebCore::GraphicsLayer::PlatformLayerID, const String&amp; key, double startTime);
</span><ins>+    void animationDidEnd(WebCore::GraphicsLayer::PlatformLayerID, const String&amp; key);
</ins><span class="cx"> 
</span><span class="cx">     void willStartAnimationOnLayer(PlatformCALayerRemote&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -78,7 +79,7 @@
</span><span class="cx">     Vector&lt;WebCore::GraphicsLayer::PlatformLayerID&gt; m_destroyedLayers;
</span><span class="cx"> 
</span><span class="cx">     HashMap&lt;WebCore::GraphicsLayer::PlatformLayerID, PlatformCALayerRemote*&gt; m_liveLayers;
</span><del>-    HashMap&lt;WebCore::GraphicsLayer::PlatformLayerID, PlatformCALayerRemote*&gt; m_layersAwaitingAnimationStart;
</del><ins>+    HashMap&lt;WebCore::GraphicsLayer::PlatformLayerID, PlatformCALayerRemote*&gt; m_layersWithAnimations;
</ins><span class="cx"> 
</span><span class="cx">     RemoteLayerBackingStoreCollection m_backingStoreCollection;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeContextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">     ASSERT(!m_destroyedLayers.contains(layerID));
</span><span class="cx">     m_destroyedLayers.append(layerID);
</span><span class="cx">     
</span><del>-    m_layersAwaitingAnimationStart.remove(layerID);
</del><ins>+    m_layersWithAnimations.remove(layerID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RemoteLayerTreeContext::backingStoreWasCreated(RemoteLayerBackingStore&amp; backingStore)
</span><span class="lines">@@ -122,14 +122,21 @@
</span><span class="cx"> 
</span><span class="cx"> void RemoteLayerTreeContext::willStartAnimationOnLayer(PlatformCALayerRemote&amp; layer)
</span><span class="cx"> {
</span><del>-    m_layersAwaitingAnimationStart.add(layer.layerID(), &amp;layer);
</del><ins>+    m_layersWithAnimations.add(layer.layerID(), &amp;layer);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RemoteLayerTreeContext::animationDidStart(WebCore::GraphicsLayer::PlatformLayerID layerID, const String&amp; key, double startTime)
</span><span class="cx"> {
</span><del>-    auto it = m_layersAwaitingAnimationStart.find(layerID);
-    if (it != m_layersAwaitingAnimationStart.end())
</del><ins>+    auto it = m_layersWithAnimations.find(layerID);
+    if (it != m_layersWithAnimations.end())
</ins><span class="cx">         it-&gt;value-&gt;animationStarted(key, startTime);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RemoteLayerTreeContext::animationDidEnd(WebCore::GraphicsLayer::PlatformLayerID layerID, const String&amp; key)
+{
+    auto it = m_layersWithAnimations.find(layerID);
+    if (it != m_layersWithAnimations.end())
+        it-&gt;value-&gt;animationEnded(key);
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -88,6 +88,7 @@
</span><span class="cx">     virtual WebCore::FloatRect exposedRect() const override { return m_scrolledExposedRect; }
</span><span class="cx"> 
</span><span class="cx">     virtual void acceleratedAnimationDidStart(uint64_t layerID, const String&amp; key, double startTime) override;
</span><ins>+    virtual void acceleratedAnimationDidEnd(uint64_t layerID, const String&amp; key) override;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     virtual void setExposedContentRect(const WebCore::FloatRect&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (172835 => 172836)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2014-08-21 21:34:21 UTC (rev 172835)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2014-08-21 22:43:18 UTC (rev 172836)
</span><span class="lines">@@ -193,6 +193,11 @@
</span><span class="cx">     m_remoteLayerTreeContext-&gt;animationDidStart(layerID, key, startTime);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RemoteLayerTreeDrawingArea::acceleratedAnimationDidEnd(uint64_t layerID, const String&amp; key)
+{
+    m_remoteLayerTreeContext-&gt;animationDidEnd(layerID, key);
+}
+
</ins><span class="cx"> void RemoteLayerTreeDrawingArea::setExposedRect(const FloatRect&amp; exposedRect)
</span><span class="cx"> {
</span><span class="cx">     m_exposedRect = exposedRect;
</span></span></pre>
</div>
</div>

</body>
</html>