<!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>[168898] 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/168898">168898</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-05-15 09:35:00 -0700 (Thu, 15 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Clean up &quot;has non-zero begin time&quot; terminology in animations
https://bugs.webkit.org/show_bug.cgi?id=132942

Reviewed by Tim Horton.

Change the &quot;non-zero beginTime&quot; terminology in the platform CA animations
code to &quot;explicit beginTime&quot;: this flag really means that we explicitly set
the beginTime of the animation, rather than let CA set the beginTime when
committing the animation. This flag is used for animations with negative
delay, and when pausing.

Source/WebCore:

The WKNonZeroBeginTimeFlag key was spread across PlatformCALayerMac and PlatformCAAnimationMac,
so hide it behind getter/setter functions.

Remove lots of m_layer.get() in PlatformCAAnimationMac.

* platform/graphics/ca/mac/PlatformCAAnimationMac.h:
* platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
(WebCore::hasExplicitBeginTime):
(WebCore::setHasExplicitBeginTime):
(PlatformCAAnimationMac::copy):
(PlatformCAAnimationMac::keyPath):
(PlatformCAAnimationMac::beginTime):
(PlatformCAAnimationMac::setBeginTime):
(PlatformCAAnimationMac::duration):
(PlatformCAAnimationMac::setDuration):
(PlatformCAAnimationMac::speed):
(PlatformCAAnimationMac::setSpeed):
(PlatformCAAnimationMac::timeOffset):
(PlatformCAAnimationMac::setTimeOffset):
(PlatformCAAnimationMac::repeatCount):
(PlatformCAAnimationMac::setRepeatCount):
(PlatformCAAnimationMac::autoreverses):
(PlatformCAAnimationMac::setAutoreverses):
(PlatformCAAnimationMac::fillMode):
(PlatformCAAnimationMac::setFillMode):
(PlatformCAAnimationMac::setTimingFunction):
(PlatformCAAnimationMac::copyTimingFunctionFrom):
(PlatformCAAnimationMac::isRemovedOnCompletion):
(PlatformCAAnimationMac::setRemovedOnCompletion):
(PlatformCAAnimationMac::isAdditive):
(PlatformCAAnimationMac::setAdditive):
(PlatformCAAnimationMac::valueFunction):
(PlatformCAAnimationMac::setValueFunction):
(hasNonZeroBeginTimeFlag): Deleted.
(setNonZeroBeginTimeFlag): Deleted.
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(-[WebAnimationDelegate animationDidStart:]):

Source/WebKit2:

* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTextStream::operator&lt;&lt;):
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
(-[WKAnimationDelegate animationDidStart:]):
(WebKit::PlatformCAAnimationRemote::Properties::encode):
(WebKit::PlatformCAAnimationRemote::Properties::decode):
(WebKit::PlatformCAAnimationRemote::setBeginTime):
(WebKit::addAnimationToLayer):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCAAnimationMach">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCAAnimationMacmm">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCAAnimationRemoteh">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCAAnimationRemotemm">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (168897 => 168898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-15 15:18:57 UTC (rev 168897)
+++ trunk/Source/WebCore/ChangeLog        2014-05-15 16:35:00 UTC (rev 168898)
</span><span class="lines">@@ -1,3 +1,54 @@
</span><ins>+2014-05-14  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Clean up &quot;has non-zero begin time&quot; terminology in animations
+        https://bugs.webkit.org/show_bug.cgi?id=132942
+
+        Reviewed by Tim Horton.
+
+        Change the &quot;non-zero beginTime&quot; terminology in the platform CA animations
+        code to &quot;explicit beginTime&quot;: this flag really means that we explicitly set
+        the beginTime of the animation, rather than let CA set the beginTime when
+        committing the animation. This flag is used for animations with negative
+        delay, and when pausing.
+        
+        The WKNonZeroBeginTimeFlag key was spread across PlatformCALayerMac and PlatformCAAnimationMac,
+        so hide it behind getter/setter functions.
+        
+        Remove lots of m_layer.get() in PlatformCAAnimationMac.
+
+        * platform/graphics/ca/mac/PlatformCAAnimationMac.h:
+        * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
+        (WebCore::hasExplicitBeginTime):
+        (WebCore::setHasExplicitBeginTime):
+        (PlatformCAAnimationMac::copy):
+        (PlatformCAAnimationMac::keyPath):
+        (PlatformCAAnimationMac::beginTime):
+        (PlatformCAAnimationMac::setBeginTime):
+        (PlatformCAAnimationMac::duration):
+        (PlatformCAAnimationMac::setDuration):
+        (PlatformCAAnimationMac::speed):
+        (PlatformCAAnimationMac::setSpeed):
+        (PlatformCAAnimationMac::timeOffset):
+        (PlatformCAAnimationMac::setTimeOffset):
+        (PlatformCAAnimationMac::repeatCount):
+        (PlatformCAAnimationMac::setRepeatCount):
+        (PlatformCAAnimationMac::autoreverses):
+        (PlatformCAAnimationMac::setAutoreverses):
+        (PlatformCAAnimationMac::fillMode):
+        (PlatformCAAnimationMac::setFillMode):
+        (PlatformCAAnimationMac::setTimingFunction):
+        (PlatformCAAnimationMac::copyTimingFunctionFrom):
+        (PlatformCAAnimationMac::isRemovedOnCompletion):
+        (PlatformCAAnimationMac::setRemovedOnCompletion):
+        (PlatformCAAnimationMac::isAdditive):
+        (PlatformCAAnimationMac::setAdditive):
+        (PlatformCAAnimationMac::valueFunction):
+        (PlatformCAAnimationMac::setValueFunction):
+        (hasNonZeroBeginTimeFlag): Deleted.
+        (setNonZeroBeginTimeFlag): Deleted.
+        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+        (-[WebAnimationDelegate animationDidStart:]):
+
</ins><span class="cx"> 2014-05-15  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Compile all installed resources as GResources
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCAAnimationMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h (168897 => 168898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h        2014-05-15 15:18:57 UTC (rev 168897)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h        2014-05-15 16:35:00 UTC (rev 168898)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> OBJC_CLASS CAMediaTimingFunction;
</span><ins>+OBJC_CLASS CAAnimation;
</ins><span class="cx"> OBJC_CLASS CAPropertyAnimation;
</span><span class="cx"> OBJC_CLASS NSString;
</span><span class="cx"> 
</span><span class="lines">@@ -42,6 +43,9 @@
</span><span class="cx"> NSString* toCAValueFunctionType(PlatformCAAnimation::ValueFunctionType);
</span><span class="cx"> CAMediaTimingFunction* toCAMediaTimingFunction(const TimingFunction*, bool reverse);
</span><span class="cx"> 
</span><ins>+bool hasExplicitBeginTime(CAAnimation *);
+void setHasExplicitBeginTime(CAAnimation *, bool);
+
</ins><span class="cx"> class PlatformCAAnimationMac final : public PlatformCAAnimation {
</span><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;PlatformCAAnimation&gt; create(AnimationType, const String&amp; keyPath);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCAAnimationMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm (168897 => 168898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm        2014-05-15 15:18:57 UTC (rev 168897)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm        2014-05-15 16:35:00 UTC (rev 168898)
</span><span class="lines">@@ -35,17 +35,16 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><del>-// This value must be the same as in PlatformCALayerMac.mm
-static NSString * const WKNonZeroBeginTimeFlag = @&quot;WKPlatformCAAnimationNonZeroBeginTimeFlag&quot;;
</del><ins>+static NSString * const WKExplicitBeginTimeFlag = @&quot;WKPlatformCAAnimationExplicitBeginTimeFlag&quot;;
</ins><span class="cx"> 
</span><del>-static bool hasNonZeroBeginTimeFlag(const PlatformCAAnimation* animation)
</del><ins>+bool WebCore::hasExplicitBeginTime(CAAnimation *animation)
</ins><span class="cx"> {
</span><del>-    return [[toPlatformCAAnimationMac(animation)-&gt;platformAnimation() valueForKey:WKNonZeroBeginTimeFlag] boolValue];
</del><ins>+    return [[animation valueForKey:WKExplicitBeginTimeFlag] boolValue];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void setNonZeroBeginTimeFlag(PlatformCAAnimation* animation, bool value)
</del><ins>+void WebCore::setHasExplicitBeginTime(CAAnimation *animation, bool value)
</ins><span class="cx"> {
</span><del>-    [toPlatformCAAnimationMac(animation)-&gt;platformAnimation() setValue:[NSNumber numberWithBool:value] forKey:WKNonZeroBeginTimeFlag];
</del><ins>+    [animation setValue:[NSNumber numberWithBool:value] forKey:WKExplicitBeginTimeFlag];
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> NSString* WebCore::toCAFillModeType(PlatformCAAnimation::FillModeType type)
</span><span class="lines">@@ -203,7 +202,7 @@
</span><span class="cx">     animation-&gt;copyTimingFunctionFrom(this);
</span><span class="cx">     animation-&gt;setValueFunction(valueFunction());
</span><span class="cx"> 
</span><del>-    setNonZeroBeginTimeFlag(animation.get(), hasNonZeroBeginTimeFlag(this));
</del><ins>+    setHasExplicitBeginTime(toPlatformCAAnimationMac(animation.get())-&gt;platformAnimation(), hasExplicitBeginTime(platformAnimation()));
</ins><span class="cx">     
</span><span class="cx">     // Copy the specific Basic or Keyframe values
</span><span class="cx">     if (animationType() == Keyframe) {
</span><span class="lines">@@ -225,125 +224,125 @@
</span><span class="cx"> 
</span><span class="cx"> String PlatformCAAnimationMac::keyPath() const
</span><span class="cx"> {
</span><del>-    return [m_animation.get() keyPath];
</del><ins>+    return [m_animation keyPath];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CFTimeInterval PlatformCAAnimationMac::beginTime() const
</span><span class="cx"> {
</span><del>-    return [m_animation.get() beginTime];
</del><ins>+    return [m_animation beginTime];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::setBeginTime(CFTimeInterval value)
</span><span class="cx"> {
</span><del>-    [m_animation.get() setBeginTime:value];
</del><ins>+    [m_animation setBeginTime:value];
</ins><span class="cx">     
</span><span class="cx">     // Also set a flag to tell us if we've passed in a 0 value. 
</span><span class="cx">     // The flag is needed because later beginTime will get changed
</span><span class="cx">     // to the time at which it fired and we need to know whether
</span><span class="cx">     // or not it was 0 to begin with.
</span><span class="cx">     if (value)
</span><del>-        setNonZeroBeginTimeFlag(this, true);
</del><ins>+        setHasExplicitBeginTime(m_animation.get(), true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CFTimeInterval PlatformCAAnimationMac::duration() const
</span><span class="cx"> {
</span><del>-    return [m_animation.get() duration];
</del><ins>+    return [m_animation duration];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::setDuration(CFTimeInterval value)
</span><span class="cx"> {
</span><del>-    [m_animation.get() setDuration:value];
</del><ins>+    [m_animation setDuration:value];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> float PlatformCAAnimationMac::speed() const
</span><span class="cx"> {
</span><del>-    return [m_animation.get() speed];
</del><ins>+    return [m_animation speed];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::setSpeed(float value)
</span><span class="cx"> {
</span><del>-    [m_animation.get() setSpeed:value];
</del><ins>+    [m_animation setSpeed:value];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CFTimeInterval PlatformCAAnimationMac::timeOffset() const
</span><span class="cx"> {
</span><del>-    return [m_animation.get() timeOffset];
</del><ins>+    return [m_animation timeOffset];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::setTimeOffset(CFTimeInterval value)
</span><span class="cx"> {
</span><del>-    [m_animation.get() setTimeOffset:value];
</del><ins>+    [m_animation setTimeOffset:value];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> float PlatformCAAnimationMac::repeatCount() const
</span><span class="cx"> {
</span><del>-    return [m_animation.get() repeatCount];
</del><ins>+    return [m_animation repeatCount];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::setRepeatCount(float value)
</span><span class="cx"> {
</span><del>-    [m_animation.get() setRepeatCount:value];
</del><ins>+    [m_animation setRepeatCount:value];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool PlatformCAAnimationMac::autoreverses() const
</span><span class="cx"> {
</span><del>-    return [m_animation.get() autoreverses];
</del><ins>+    return [m_animation autoreverses];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::setAutoreverses(bool value)
</span><span class="cx"> {
</span><del>-    [m_animation.get() setAutoreverses:value];
</del><ins>+    [m_animation setAutoreverses:value];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PlatformCAAnimation::FillModeType PlatformCAAnimationMac::fillMode() const
</span><span class="cx"> {
</span><del>-    return fromCAFillModeType([m_animation.get() fillMode]);
</del><ins>+    return fromCAFillModeType([m_animation fillMode]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::setFillMode(FillModeType value)
</span><span class="cx"> {
</span><del>-    [m_animation.get() setFillMode:toCAFillModeType(value)];
</del><ins>+    [m_animation setFillMode:toCAFillModeType(value)];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::setTimingFunction(const TimingFunction* value, bool reverse)
</span><span class="cx"> {
</span><del>-    [m_animation.get() setTimingFunction:toCAMediaTimingFunction(value, reverse)];
</del><ins>+    [m_animation setTimingFunction:toCAMediaTimingFunction(value, reverse)];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::copyTimingFunctionFrom(const PlatformCAAnimation* value)
</span><span class="cx"> {
</span><del>-    [m_animation.get() setTimingFunction:[toPlatformCAAnimationMac(value)-&gt;m_animation.get() timingFunction]];
</del><ins>+    [m_animation setTimingFunction:[toPlatformCAAnimationMac(value)-&gt;m_animation.get() timingFunction]];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool PlatformCAAnimationMac::isRemovedOnCompletion() const
</span><span class="cx"> {
</span><del>-    return [m_animation.get() isRemovedOnCompletion];
</del><ins>+    return [m_animation isRemovedOnCompletion];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::setRemovedOnCompletion(bool value)
</span><span class="cx"> {
</span><del>-    [m_animation.get() setRemovedOnCompletion:value];
</del><ins>+    [m_animation setRemovedOnCompletion:value];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool PlatformCAAnimationMac::isAdditive() const
</span><span class="cx"> {
</span><del>-    return [m_animation.get() isAdditive];
</del><ins>+    return [m_animation isAdditive];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::setAdditive(bool value)
</span><span class="cx"> {
</span><del>-    [m_animation.get() setAdditive:value];
</del><ins>+    [m_animation setAdditive:value];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PlatformCAAnimation::ValueFunctionType PlatformCAAnimationMac::valueFunction() const
</span><span class="cx"> {
</span><del>-    CAValueFunction* vf = [m_animation.get() valueFunction];
</del><ins>+    CAValueFunction* vf = [m_animation valueFunction];
</ins><span class="cx">     return fromCAValueFunctionType([vf name]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::setValueFunction(ValueFunctionType value)
</span><span class="cx"> {
</span><del>-    [m_animation.get() setValueFunction:[CAValueFunction functionWithName:toCAValueFunctionType(value)]];
</del><ins>+    [m_animation setValueFunction:[CAValueFunction functionWithName:toCAValueFunctionType(value)]];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationMac::setFromValue(float value)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (168897 => 168898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2014-05-15 15:18:57 UTC (rev 168897)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2014-05-15 16:35:00 UTC (rev 168898)
</span><span class="lines">@@ -86,9 +86,6 @@
</span><span class="cx">     return platformCALayer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// This value must be the same as in PlatformCAAnimationMac.mm
-static NSString * const WKNonZeroBeginTimeFlag = @&quot;WKPlatformCAAnimationNonZeroBeginTimeFlag&quot;;
-
</del><span class="cx"> static double mediaTimeToCurrentTime(CFTimeInterval t)
</span><span class="cx"> {
</span><span class="cx">     return monotonicallyIncreasingTime() + t - CACurrentMediaTime();
</span><span class="lines">@@ -111,11 +108,8 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     WebThreadLock();
</span><span class="cx"> #endif
</span><del>-    // hasNonZeroBeginTime is stored in a key in the animation
-    bool hasNonZeroBeginTime = [[animation valueForKey:WKNonZeroBeginTimeFlag] boolValue];
</del><span class="cx">     CFTimeInterval startTime;
</span><del>-
-    if (hasNonZeroBeginTime) {
</del><ins>+    if (hasExplicitBeginTime(animation)) {
</ins><span class="cx">         // We don't know what time CA used to commit the animation, so just use the current time
</span><span class="cx">         // (even though this will be slightly off).
</span><span class="cx">         startTime = mediaTimeToCurrentTime(CACurrentMediaTime());
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (168897 => 168898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-15 15:18:57 UTC (rev 168897)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-15 16:35:00 UTC (rev 168898)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2014-05-14  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Clean up &quot;has non-zero begin time&quot; terminology in animations
+        https://bugs.webkit.org/show_bug.cgi?id=132942
+
+        Reviewed by Tim Horton.
+
+        Change the &quot;non-zero beginTime&quot; terminology in the platform CA animations
+        code to &quot;explicit beginTime&quot;: this flag really means that we explicitly set
+        the beginTime of the animation, rather than let CA set the beginTime when
+        committing the animation. This flag is used for animations with negative
+        delay, and when pausing.
+
+        * Shared/mac/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTextStream::operator&lt;&lt;):
+        * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
+        * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
+        (-[WKAnimationDelegate animationDidStart:]):
+        (WebKit::PlatformCAAnimationRemote::Properties::encode):
+        (WebKit::PlatformCAAnimationRemote::Properties::decode):
+        (WebKit::PlatformCAAnimationRemote::setBeginTime):
+        (WebKit::addAnimationToLayer):
+
</ins><span class="cx"> 2014-05-15  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Incremental updates during scroll-to-top shouldn’t count as “stable” updates
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (168897 => 168898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2014-05-15 15:18:57 UTC (rev 168897)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2014-05-15 16:35:00 UTC (rev 168898)
</span><span class="lines">@@ -885,8 +885,8 @@
</span><span class="cx">     if (animation.reverseTimingFunctions)
</span><span class="cx">         dumpProperty(ts, &quot;reverseTimingFunctions&quot;, animation.reverseTimingFunctions);
</span><span class="cx"> 
</span><del>-    if (animation.hasNonZeroBeginTime)
-        dumpProperty(ts, &quot;hasNonZeroBeginTime&quot;, animation.hasNonZeroBeginTime);
</del><ins>+    if (animation.hasExplicitBeginTime)
+        dumpProperty(ts, &quot;hasExplicitBeginTime&quot;, animation.hasExplicitBeginTime);
</ins><span class="cx"> 
</span><span class="cx">     ts &lt;&lt; &quot;\n&quot;;
</span><span class="cx">     ts.increaseIndent();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCAAnimationRemoteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.h (168897 => 168898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.h        2014-05-15 15:18:57 UTC (rev 168897)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.h        2014-05-15 16:35:00 UTC (rev 168898)
</span><span class="lines">@@ -254,7 +254,7 @@
</span><span class="cx">             , removedOnCompletion(true)
</span><span class="cx">             , additive(false)
</span><span class="cx">             , reverseTimingFunctions(false)
</span><del>-            , hasNonZeroBeginTime(false)
</del><ins>+            , hasExplicitBeginTime(false)
</ins><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -277,7 +277,7 @@
</span><span class="cx">         bool removedOnCompletion;
</span><span class="cx">         bool additive;
</span><span class="cx">         bool reverseTimingFunctions;
</span><del>-        bool hasNonZeroBeginTime;
</del><ins>+        bool hasExplicitBeginTime;
</ins><span class="cx"> 
</span><span class="cx">         // For basic animations, these vectors have two entries. For keyframe animations, two or more.
</span><span class="cx">         // timingFunctions has n-1 entries.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCAAnimationRemotemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm (168897 => 168898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm        2014-05-15 15:18:57 UTC (rev 168897)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm        2014-05-15 16:35:00 UTC (rev 168898)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">     return monotonicallyIncreasingTime() + t - CACurrentMediaTime();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static NSString * const WKNonZeroBeginTimeFlag = @&quot;WKPlatformCAAnimationNonZeroBeginTimeFlag&quot;;
</del><ins>+static NSString * const WKExplicitBeginTimeFlag = @&quot;WKPlatformCAAnimationExplicitBeginTimeFlag&quot;;
</ins><span class="cx"> 
</span><span class="cx"> @interface WKAnimationDelegate : NSObject {
</span><span class="cx">     GraphicsLayer::PlatformLayerID _layerID;
</span><span class="lines">@@ -69,10 +69,10 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)animationDidStart:(CAAnimation *)animation
</span><span class="cx"> {
</span><del>-    bool hasNonZeroBeginTime = [[animation valueForKey:WKNonZeroBeginTimeFlag] boolValue];
</del><ins>+    bool hasExplicitBeginTime = [[animation valueForKey:WKExplicitBeginTimeFlag] boolValue];
</ins><span class="cx">     CFTimeInterval startTime;
</span><span class="cx"> 
</span><del>-    if (hasNonZeroBeginTime) {
</del><ins>+    if (hasExplicitBeginTime) {
</ins><span class="cx">         // We don't know what time CA used to commit the animation, so just use the current time
</span><span class="cx">         // (even though this will be slightly off).
</span><span class="cx">         startTime = mediaTimeToCurrentTime(CACurrentMediaTime());
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx">     encoder &lt;&lt; removedOnCompletion;
</span><span class="cx">     encoder &lt;&lt; additive;
</span><span class="cx">     encoder &lt;&lt; reverseTimingFunctions;
</span><del>-    encoder &lt;&lt; hasNonZeroBeginTime;
</del><ins>+    encoder &lt;&lt; hasExplicitBeginTime;
</ins><span class="cx">     
</span><span class="cx">     encoder &lt;&lt; keyValues;
</span><span class="cx">     encoder &lt;&lt; keyTimes;
</span><span class="lines">@@ -221,7 +221,7 @@
</span><span class="cx">     if (!decoder.decode(properties.reverseTimingFunctions))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (!decoder.decode(properties.hasNonZeroBeginTime))
</del><ins>+    if (!decoder.decode(properties.hasExplicitBeginTime))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!decoder.decode(properties.keyValues))
</span><span class="lines">@@ -308,7 +308,7 @@
</span><span class="cx">     // to the time at which it fired and we need to know whether
</span><span class="cx">     // or not it was 0 to begin with.
</span><span class="cx">     if (value)
</span><del>-        m_properties.hasNonZeroBeginTime = value;
</del><ins>+        m_properties.hasExplicitBeginTime = value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CFTimeInterval PlatformCAAnimationRemote::duration() const
</span><span class="lines">@@ -718,8 +718,8 @@
</span><span class="cx">     if (properties.valueFunction != PlatformCAAnimation::NoValueFunction)
</span><span class="cx">         [caAnimation setValueFunction:[CAValueFunction functionWithName:toCAValueFunctionType(properties.valueFunction)]];
</span><span class="cx">     
</span><del>-    if (properties.hasNonZeroBeginTime)
-        [caAnimation.get()  setValue:@YES forKey:WKNonZeroBeginTimeFlag];
</del><ins>+    if (properties.hasExplicitBeginTime)
+        [caAnimation.get()  setValue:@YES forKey:WKExplicitBeginTimeFlag];
</ins><span class="cx">     
</span><span class="cx">     if (layerTreeHost) {
</span><span class="cx">         GraphicsLayer::PlatformLayerID layerID = RemoteLayerTreeHost::layerID(layer);
</span></span></pre>
</div>
</div>

</body>
</html>