<!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>[166588] trunk/Source/WebKit2</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/166588">166588</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-04-01 08:29:16 -0700 (Tue, 01 Apr 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[UI-side compositing] Fix animations, and add logging
https://bugs.webkit.org/show_bug.cgi?id=131011
Reviewed by Tim Horton.
UI-side animations were broken because GraphicsLayerCARemote::addAnimation()
never called the superclass, so fix.
Add logging for animations to the layer tree commit output.
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::dumpProperty):
(WebKit::RemoteLayerTreeTextStream::operator<<):
(WebKit::dumpChangedLayers):
* WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
(WebKit::GraphicsLayerCARemote::addAnimation):</pre>
<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceWebKit2WebProcessWebPagemacGraphicsLayerCARemotecpp">trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (166587 => 166588)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-04-01 15:28:36 UTC (rev 166587)
+++ trunk/Source/WebKit2/ChangeLog        2014-04-01 15:29:16 UTC (rev 166588)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-03-31 Simon Fraser <simon.fraser@apple.com>
+
+ [UI-side compositing] Fix animations, and add logging
+ https://bugs.webkit.org/show_bug.cgi?id=131011
+
+ Reviewed by Tim Horton.
+
+ UI-side animations were broken because GraphicsLayerCARemote::addAnimation()
+ never called the superclass, so fix.
+
+ Add logging for animations to the layer tree commit output.
+
+ * Shared/mac/RemoteLayerTreeTransaction.mm:
+ (WebKit::dumpProperty):
+ (WebKit::RemoteLayerTreeTextStream::operator<<):
+ (WebKit::dumpChangedLayers):
+ * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
+ (WebKit::GraphicsLayerCARemote::addAnimation):
+
</ins><span class="cx"> 2014-04-01 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> Build fix after r166582.
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (166587 => 166588)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2014-04-01 15:28:36 UTC (rev 166587)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2014-04-01 15:29:16 UTC (rev 166588)
</span><span class="lines">@@ -29,10 +29,12 @@
</span><span class="cx"> #import "ArgumentCoders.h"
</span><span class="cx"> #import "MessageDecoder.h"
</span><span class="cx"> #import "MessageEncoder.h"
</span><ins>+#import "PlatformCAAnimationRemote.h"
</ins><span class="cx"> #import "PlatformCALayerRemote.h"
</span><span class="cx"> #import "WebCoreArgumentCoders.h"
</span><span class="cx"> #import <QuartzCore/QuartzCore.h>
</span><span class="cx"> #import <WebCore/TextStream.h>
</span><ins>+#import <WebCore/TimingFunction.h>
</ins><span class="cx"> #import <wtf/text/CString.h>
</span><span class="cx"> #import <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><span class="lines">@@ -557,9 +559,15 @@
</span><span class="cx"> RemoteLayerTreeTextStream& operator<<(FloatPoint3D);
</span><span class="cx"> RemoteLayerTreeTextStream& operator<<(Color);
</span><span class="cx"> RemoteLayerTreeTextStream& operator<<(FloatRect);
</span><del>- RemoteLayerTreeTextStream& operator<<(const Vector<WebCore::GraphicsLayer::PlatformLayerID>& layers);
</del><ins>+ RemoteLayerTreeTextStream& operator<<(const Vector<WebCore::GraphicsLayer::PlatformLayerID>&);
</ins><span class="cx"> RemoteLayerTreeTextStream& operator<<(const FilterOperations&);
</span><del>- RemoteLayerTreeTextStream& operator<<(const RemoteLayerBackingStore& backingStore);
</del><ins>+ RemoteLayerTreeTextStream& operator<<(const PlatformCAAnimationRemote::Properties&);
+ RemoteLayerTreeTextStream& operator<<(const RemoteLayerBackingStore&);
+ RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::AnimationType);
+ RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::FillModeType);
+ RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::ValueFunctionType);
+ RemoteLayerTreeTextStream& operator<<(const TimingFunction&);
+ RemoteLayerTreeTextStream& operator<<(const PlatformCAAnimationRemote::KeyframeValue&);
</ins><span class="cx">
</span><span class="cx"> void increaseIndent() { ++m_indent; }
</span><span class="cx"> void decreaseIndent() { --m_indent; ASSERT(m_indent >= 0); }
</span><span class="lines">@@ -570,6 +578,17 @@
</span><span class="cx"> int m_indent;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+template <class T>
+static void dumpProperty(RemoteLayerTreeTextStream& ts, String name, T value)
+{
+ ts << "\n";
+ ts.increaseIndent();
+ ts.writeIndent();
+ ts << "(" << name << " ";
+ ts << value << ")";
+ ts.decreaseIndent();
+}
+
</ins><span class="cx"> RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const TransformationMatrix& transform)
</span><span class="cx"> {
</span><span class="cx"> RemoteLayerTreeTextStream& ts = *this;
</span><span class="lines">@@ -660,6 +679,165 @@
</span><span class="cx"> return ts;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(PlatformCAAnimation::AnimationType type)
+{
+ RemoteLayerTreeTextStream& ts = *this;
+ switch (type) {
+ case PlatformCAAnimation::Basic: ts << "basic"; break;
+ case PlatformCAAnimation::Keyframe: ts << "keyframe"; break;
+ }
+ return ts;
+}
+
+RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(PlatformCAAnimation::FillModeType type)
+{
+ RemoteLayerTreeTextStream& ts = *this;
+ switch (type) {
+ case PlatformCAAnimation::NoFillMode: ts << "none"; break;
+ case PlatformCAAnimation::Forwards: ts << "forwards"; break;
+ case PlatformCAAnimation::Backwards: ts << "backwards"; break;
+ case PlatformCAAnimation::Both: ts << "both"; break;
+ }
+ return ts;
+}
+
+RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(PlatformCAAnimation::ValueFunctionType type)
+{
+ RemoteLayerTreeTextStream& ts = *this;
+ switch (type) {
+ case PlatformCAAnimation::NoValueFunction: ts << "none"; break;
+ case PlatformCAAnimation::RotateX: ts << "rotateX"; break;
+ case PlatformCAAnimation::RotateY: ts << "rotateY"; break;
+ case PlatformCAAnimation::RotateZ: ts << "rotateX"; break;
+ case PlatformCAAnimation::ScaleX: ts << "scaleX"; break;
+ case PlatformCAAnimation::ScaleY: ts << "scaleY"; break;
+ case PlatformCAAnimation::ScaleZ: ts << "scaleX"; break;
+ case PlatformCAAnimation::Scale: ts << "scale"; break;
+ case PlatformCAAnimation::TranslateX: ts << "translateX"; break;
+ case PlatformCAAnimation::TranslateY: ts << "translateY"; break;
+ case PlatformCAAnimation::TranslateZ: ts << "translateZ"; break;
+ case PlatformCAAnimation::Translate: ts << "translate"; break;
+ }
+ return ts;
+}
+
+RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const PlatformCAAnimationRemote::KeyframeValue& value)
+{
+ RemoteLayerTreeTextStream& ts = *this;
+
+ switch (value.keyframeType()) {
+ case PlatformCAAnimationRemote::KeyframeValue::NumberKeyType:
+ ts << "number=" << value.numberValue();
+ break;
+ case PlatformCAAnimationRemote::KeyframeValue::ColorKeyType:
+ ts << "color=";
+ ts << value.colorValue();
+ break;
+ case PlatformCAAnimationRemote::KeyframeValue::PointKeyType:
+ ts << "point=";
+ ts << value.pointValue();
+ break;
+ case PlatformCAAnimationRemote::KeyframeValue::TransformKeyType:
+ ts << "transform=";
+ ts << value.transformValue();
+ break;
+ }
+ return ts;
+}
+
+RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const TimingFunction& timingFunction)
+{
+ RemoteLayerTreeTextStream& ts = *this;
+ switch (timingFunction.type()) {
+ case TimingFunction::LinearFunction:
+ ts << "linear";
+ break;
+ case TimingFunction::CubicBezierFunction: {
+ const CubicBezierTimingFunction& cubicBezierFunction = static_cast<const CubicBezierTimingFunction&>(timingFunction);
+ ts << "cubic-bezier(" << cubicBezierFunction.x1() << ", " << cubicBezierFunction.y1() << ", " << cubicBezierFunction.x2() << ", " << cubicBezierFunction.y2() << ")";
+ break;
+ }
+ case TimingFunction::StepsFunction: {
+ const StepsTimingFunction& stepsFunction = static_cast<const StepsTimingFunction&>(timingFunction);
+ ts << "steps(" << stepsFunction.numberOfSteps() << ", " << (stepsFunction.stepAtStart() ? "start" : "end") << ")";
+ break;
+ }
+ }
+ return ts;
+}
+
+RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const PlatformCAAnimationRemote::Properties& animation)
+{
+ RemoteLayerTreeTextStream& ts = *this;
+
+ ts << "type=";
+ ts << animation.animationType;
+ ts << " keyPath=";
+ ts << animation.keyPath;
+
+ if (animation.beginTime)
+ dumpProperty(ts, "beginTime", animation.beginTime);
+
+ if (animation.duration)
+ dumpProperty(ts, "duration", animation.duration);
+
+ if (animation.timeOffset)
+ dumpProperty(ts, "timeOffset", animation.timeOffset);
+
+ dumpProperty(ts, "repeatCount", animation.repeatCount);
+
+ if (animation.speed != 1)
+ dumpProperty(ts, "speed", animation.speed);
+
+ dumpProperty(ts, "fillMode", animation.fillMode);
+ dumpProperty(ts, "valueFunction", animation.valueFunction);
+
+ if (animation.autoReverses)
+ dumpProperty(ts, "autoReverses", animation.autoReverses);
+
+ if (!animation.removedOnCompletion)
+ dumpProperty(ts, "removedOnCompletion", animation.removedOnCompletion);
+
+ if (animation.additive)
+ dumpProperty(ts, "additive", animation.additive);
+
+ if (animation.reverseTimingFunctions)
+ dumpProperty(ts, "reverseTimingFunctions", animation.reverseTimingFunctions);
+
+ if (animation.hasNonZeroBeginTime)
+ dumpProperty(ts, "hasNonZeroBeginTime", animation.hasNonZeroBeginTime);
+
+ ts << "\n";
+ ts.increaseIndent();
+ ts.writeIndent();
+ ts << "(" << "keyframes";
+ ts.increaseIndent();
+
+ size_t maxFrames = std::max(animation.keyValues.size(), animation.keyTimes.size());
+ maxFrames = std::max(maxFrames, animation.timingFunctions.size());
+
+ for (size_t i = 0; i < maxFrames; ++i) {
+ ts << "\n";
+ ts.writeIndent();
+ ts << "(keyframe " << unsigned(i);
+ if (i < animation.keyTimes.size())
+ dumpProperty(ts, "time", animation.keyTimes[i]);
+
+ if (i < animation.timingFunctions.size() && animation.timingFunctions[i])
+ dumpProperty<const TimingFunction&>(ts, "timing function", *animation.timingFunctions[i]);
+
+ if (i < animation.keyValues.size())
+ dumpProperty(ts, "value", animation.keyValues[i]);
+
+ ts << ")";
+ }
+
+ ts.decreaseIndent();
+ ts.decreaseIndent();
+
+ return ts;
+}
+
</ins><span class="cx"> RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(FloatPoint3D point)
</span><span class="cx"> {
</span><span class="cx"> RemoteLayerTreeTextStream& ts = *this;
</span><span class="lines">@@ -712,17 +890,6 @@
</span><span class="cx"> *this << " ";
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template <class T>
-static void dumpProperty(RemoteLayerTreeTextStream& ts, String name, T value)
-{
- ts << "\n";
- ts.increaseIndent();
- ts.writeIndent();
- ts << "(" << name << " ";
- ts << value << ")";
- ts.decreaseIndent();
-}
-
</del><span class="cx"> static void dumpChangedLayers(RemoteLayerTreeTextStream& ts, const RemoteLayerTreeTransaction::LayerPropertiesMap& changedLayerProperties)
</span><span class="cx"> {
</span><span class="cx"> if (changedLayerProperties.isEmpty())
</span><span class="lines">@@ -751,8 +918,6 @@
</span><span class="cx"> if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged)
</span><span class="cx"> dumpProperty<Vector<GraphicsLayer::PlatformLayerID>>(ts, "children", layerProperties.children);
</span><span class="cx">
</span><del>-// FIXME: dump animations
-
</del><span class="cx"> if (layerProperties.changedProperties & RemoteLayerTreeTransaction::PositionChanged)
</span><span class="cx"> dumpProperty<FloatPoint3D>(ts, "position", layerProperties.position);
</span><span class="cx">
</span><span class="lines">@@ -826,6 +991,14 @@
</span><span class="cx"> if (layerProperties.changedProperties & RemoteLayerTreeTransaction::FiltersChanged)
</span><span class="cx"> dumpProperty<FilterOperations>(ts, "filters", layerProperties.filters ? *layerProperties.filters : FilterOperations());
</span><span class="cx">
</span><ins>+ if (layerProperties.changedProperties & RemoteLayerTreeTransaction::AnimationsChanged) {
+ for (const auto& keyValuePair : layerProperties.addedAnimations)
+ dumpProperty<PlatformCAAnimationRemote::Properties>(ts, "animation " + keyValuePair.key, keyValuePair.value);
+
+ for (const auto& name : layerProperties.keyPathsOfAnimationsToRemove)
+ dumpProperty<String>(ts, "removed animation", name);
+ }
+
</ins><span class="cx"> if (layerProperties.changedProperties & RemoteLayerTreeTransaction::EdgeAntialiasingMaskChanged)
</span><span class="cx"> dumpProperty<unsigned>(ts, "edgeAntialiasingMask", layerProperties.edgeAntialiasingMask);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacGraphicsLayerCARemotecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp (166587 => 166588)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp        2014-04-01 15:28:36 UTC (rev 166587)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp        2014-04-01 15:29:16 UTC (rev 166588)
</span><span class="lines">@@ -58,17 +58,14 @@
</span><span class="cx"> return PlatformCAAnimationRemote::create(type, keyPath);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool GraphicsLayerCARemote::addAnimation(const KeyframeValueList& valueList, const FloatSize&, const Animation* anim, const String&, double)
</del><ins>+bool GraphicsLayerCARemote::addAnimation(const KeyframeValueList& valueList, const FloatSize& boxSize, const Animation* anim, const String& animationName, double timeOffset)
</ins><span class="cx"> {
</span><del>- if (!animationCanBeAccelerated(valueList, anim))
- return false;
-
</del><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><span class="cx"> if (valueList.property() == AnimatedPropertyWebkitFilter)
</span><span class="cx"> return false;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- return true;
</del><ins>+ return GraphicsLayerCA::addAnimation(valueList, boxSize, anim, animationName, timeOffset);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre>
</div>
</div>
</body>
</html>