<!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>[197910] trunk/PerformanceTests</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/197910">197910</a></dd>
<dt>Author</dt> <dd>jonlee@apple.com</dd>
<dt>Date</dt> <dd>2016-03-09 17:38:50 -0800 (Wed, 09 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Enhance existing Animometer tests
https://bugs.webkit.org/show_bug.cgi?id=155261

Reviewed by Simon Fraser.

* Animometer/tests/master/resources/canvas-tests.js: Add a gradient to
the filled circles. To expose more of the gradient, add another circle.
(SimpleCanvasStage.call.animate): For each frame, create a gradient with
undulating stop points and colors. Fill the circles twice; once with
the solid color, and once with the gradient.

* Animometer/tests/master/resources/dom-particles.js: Refactor the
emission variables into a separate stage for this test. Add a colorOffset
variable to make the colors of each particle slightly different, since
the ramp controller can add large numbers of particles all at once, which
would otherwise get all the same color.
* Animometer/tests/master/resources/particles.js:
(initialize): Remove the code specific to the SVG mask test.

* Animometer/tests/master/resources/image-data.js:
(initialize): Remove unused local variable.
* Animometer/tests/master/resources/multiply.js:
(initialize): Make the test harder by adding more total particles.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkPerformanceTestsAnimometertestsmasterresourcescanvastestsjs">trunk/PerformanceTests/Animometer/tests/master/resources/canvas-tests.js</a></li>
<li><a href="#trunkPerformanceTestsAnimometertestsmasterresourcesdomparticlesjs">trunk/PerformanceTests/Animometer/tests/master/resources/dom-particles.js</a></li>
<li><a href="#trunkPerformanceTestsAnimometertestsmasterresourcesimagedatajs">trunk/PerformanceTests/Animometer/tests/master/resources/image-data.js</a></li>
<li><a href="#trunkPerformanceTestsAnimometertestsmasterresourcesmultiplyjs">trunk/PerformanceTests/Animometer/tests/master/resources/multiply.js</a></li>
<li><a href="#trunkPerformanceTestsAnimometertestsmasterresourcesparticlesjs">trunk/PerformanceTests/Animometer/tests/master/resources/particles.js</a></li>
<li><a href="#trunkPerformanceTestsChangeLog">trunk/PerformanceTests/ChangeLog</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkPerformanceTestsAnimometertestsmasterresourcescanvastestsjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/tests/master/resources/canvas-tests.js (197909 => 197910)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/tests/master/resources/canvas-tests.js        2016-03-10 01:38:03 UTC (rev 197909)
+++ trunk/PerformanceTests/Animometer/tests/master/resources/canvas-tests.js        2016-03-10 01:38:50 UTC (rev 197910)
</span><span class="lines">@@ -5,8 +5,8 @@
</span><span class="cx"> CanvasLineSegment = Utilities.createClass(
</span><span class="cx">     function(stage)
</span><span class="cx">     {
</span><del>-        var circle = Stage.randomInt(0, 2);
-        this._color = [&quot;#e01040&quot;, &quot;#10c030&quot;, &quot;#e05010&quot;][circle];
</del><ins>+        var circle = Stage.randomInt(0, 3);
+        this._color = [&quot;#e01040&quot;, &quot;#10c030&quot;, &quot;#744CBA&quot;, &quot;#e05010&quot;][circle];
</ins><span class="cx">         this._lineWidth = Math.pow(Pseudo.random(), 12) * 20 + 3;
</span><span class="cx">         this._omega = Pseudo.random() * 3 + 0.2;
</span><span class="cx">         var theta = Stage.randomAngle();
</span><span class="lines">@@ -133,32 +133,53 @@
</span><span class="cx">         this.context.lineCap = options[&quot;lineCap&quot;] || &quot;butt&quot;;
</span><span class="cx">         this.lineMinimum = 20;
</span><span class="cx">         this.lineLengthMaximum = 40;
</span><del>-        this.circleRadius = this.size.x / 3 / 2 - .8 * (this.lineMinimum + this.lineLengthMaximum);
</del><ins>+        this.circleRadius = this.size.x / 8 - .4 * (this.lineMinimum + this.lineLengthMaximum);
</ins><span class="cx">         this.circleX = [
</span><del>-            .55 / 3 * this.size.x,
-            1.5 / 3 * this.size.x,
-            2.45 / 3 * this.size.x
</del><ins>+            5.5 / 32 * this.size.x,
+            12.5 / 32 * this.size.x,
+            19.5 / 32 * this.size.x,
+            26.5 / 32 * this.size.x,
</ins><span class="cx">         ];
</span><span class="cx">         this.circleY = [
</span><del>-            .6 * this.size.y,
-            .4 * this.size.y,
-            .6 * this.size.y
</del><ins>+            2.1 / 3 * this.size.y,
+            0.9 / 3 * this.size.y,
+            2.1 / 3 * this.size.y,
+            0.9 / 3 * this.size.y
</ins><span class="cx">         ];
</span><ins>+        this.halfSize = this.size.multiply(.5);
+        this.twoFifthsSizeX = this.size.x * .4;
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     animate: function()
</span><span class="cx">     {
</span><span class="cx">         var context = this.context;
</span><ins>+        context.clearRect(0, 0, this.size.x, this.size.y);
</ins><span class="cx"> 
</span><del>-        context.clearRect(0, 0, this.size.x, this.size.y);
-        context.lineWidth = 30;
-        for(var i = 0; i &lt; 3; i++) {
-            context.strokeStyle = [&quot;#e01040&quot;, &quot;#10c030&quot;, &quot;#e05010&quot;][i];
-            context.fillStyle = [&quot;#70051d&quot;, &quot;#016112&quot;, &quot;#702701&quot;][i];
</del><ins>+        var angle = Stage.dateFractionalValue(3000) * Math.PI * 2;
+        var dx = this.twoFifthsSizeX * Math.cos(angle);
+        var dy = this.twoFifthsSizeX * Math.sin(angle);
+
+        var gradient = context.createLinearGradient(this.halfSize.x + dx, this.halfSize.y + dy, this.halfSize.x - dx, this.halfSize.y - dy);
+        var gradientStep = 0.5 + 0.5 * Math.sin(Stage.dateFractionalValue(5000) * Math.PI * 2);
+        var colorStopStep = Utilities.lerp(gradientStep, -.1, .1);
+        var brightnessStep = Math.round(Utilities.lerp(gradientStep, 32, 64));
+        var color1Step = &quot;rgba(&quot; + brightnessStep + &quot;,&quot; + brightnessStep + &quot;,&quot; + (brightnessStep &lt;&lt; 1) + &quot;,.4)&quot;;
+        var color2Step = &quot;rgba(&quot; + (brightnessStep &lt;&lt; 1) + &quot;,&quot; + (brightnessStep &lt;&lt; 1) + &quot;,&quot; + brightnessStep + &quot;,.4)&quot;;
+        gradient.addColorStop(0, color1Step);
+        gradient.addColorStop(.2 + colorStopStep, color1Step);
+        gradient.addColorStop(.8 - colorStopStep, color2Step);
+        gradient.addColorStop(1, color2Step);
+
+        context.lineWidth = 15;
+        for(var i = 0; i &lt; 4; i++) {
+            context.strokeStyle = [&quot;#e01040&quot;, &quot;#10c030&quot;, &quot;#744CBA&quot;, &quot;#e05010&quot;][i];
+            context.fillStyle = [&quot;#70051d&quot;, &quot;#016112&quot;, &quot;#2F0C6E&quot;, &quot;#702701&quot;][i];
</ins><span class="cx">             context.beginPath();
</span><span class="cx">                 context.arc(this.circleX[i], this.circleY[i], this.circleRadius, 0, Math.PI*2);
</span><del>-            context.stroke();
-            context.fill();
</del><ins>+                context.stroke();
+                context.fill();
+            context.fillStyle = gradient;
+                context.fill();
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         for (var i = this.offsetIndex, length = this.objects.length; i &lt; length; ++i)
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometertestsmasterresourcesdomparticlesjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/tests/master/resources/dom-particles.js (197909 => 197910)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/tests/master/resources/dom-particles.js        2016-03-10 01:38:03 UTC (rev 197909)
+++ trunk/PerformanceTests/Animometer/tests/master/resources/dom-particles.js        2016-03-10 01:38:50 UTC (rev 197910)
</span><span class="lines">@@ -22,7 +22,8 @@
</span><span class="cx"> 
</span><span class="cx">         this.element.style.width = this.size.x + &quot;px&quot;;
</span><span class="cx">         this.element.style.height = this.size.y + &quot;px&quot;;
</span><del>-        this.element.style.backgroundColor = Stage.rotatingColor(2000, .7, .45);
</del><ins>+        this.stage.colorOffset = (this.stage.colorOffset + 1) % 360;
+        this.element.style.backgroundColor = &quot;hsl(&quot; + this.stage.colorOffset + &quot;, 70%, 45%)&quot;;
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     move: function()
</span><span class="lines">@@ -31,7 +32,25 @@
</span><span class="cx">     }
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-Utilities.extendObject(ParticlesStage.prototype, {
</del><ins>+DOMParticleStage = Utilities.createSubclass(ParticlesStage,
+    function()
+    {
+        ParticlesStage.call(this);
+    }, {
+
+    initialize: function(benchmark)
+    {
+        ParticlesStage.prototype.initialize.call(this, benchmark);
+        this.emissionSpin = Stage.random(0, 3);
+        this.emitSteps = Stage.randomInt(4, 6);
+        this.emitLocation = [
+            new Point(this.size.x * .25, this.size.y * .333),
+            new Point(this.size.x * .5, this.size.y * .25),
+            new Point(this.size.x * .75, this.size.y * .333)
+        ];
+        this.colorOffset = Stage.randomInt(0, 359);
+    },
+
</ins><span class="cx">     createParticle: function()
</span><span class="cx">     {
</span><span class="cx">         return new DOMParticle(this);
</span><span class="lines">@@ -43,13 +62,13 @@
</span><span class="cx">     }
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-ParticlesBenchmark = Utilities.createSubclass(Benchmark,
</del><ins>+DOMParticleBenchmark = Utilities.createSubclass(Benchmark,
</ins><span class="cx">     function(options)
</span><span class="cx">     {
</span><del>-        Benchmark.call(this, new ParticlesStage(), options);
</del><ins>+        Benchmark.call(this, new DOMParticleStage(), options);
</ins><span class="cx">     }
</span><span class="cx"> );
</span><span class="cx"> 
</span><del>-window.benchmarkClass = ParticlesBenchmark;
</del><ins>+window.benchmarkClass = DOMParticleBenchmark;
</ins><span class="cx"> 
</span><span class="cx"> })();
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometertestsmasterresourcesimagedatajs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/tests/master/resources/image-data.js (197909 => 197910)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/tests/master/resources/image-data.js        2016-03-10 01:38:03 UTC (rev 197909)
+++ trunk/PerformanceTests/Animometer/tests/master/resources/image-data.js        2016-03-10 01:38:50 UTC (rev 197910)
</span><span class="lines">@@ -35,8 +35,6 @@
</span><span class="cx">     {
</span><span class="cx">         Stage.prototype.initialize.call(this, benchmark);
</span><span class="cx"> 
</span><del>-        var waitForLoad = new SimplePromise;
-
</del><span class="cx">         var lastPromise;
</span><span class="cx">         var images = this.images;
</span><span class="cx">         this.imageSrcs.forEach(function(imageSrc) {
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometertestsmasterresourcesmultiplyjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/tests/master/resources/multiply.js (197909 => 197910)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/tests/master/resources/multiply.js        2016-03-10 01:38:03 UTC (rev 197909)
+++ trunk/PerformanceTests/Animometer/tests/master/resources/multiply.js        2016-03-10 01:38:50 UTC (rev 197910)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx">     initialize: function(benchmark, options)
</span><span class="cx">     {
</span><span class="cx">         Stage.prototype.initialize.call(this, benchmark, options);
</span><del>-        var tileSize = Math.round(this.size.height / 20);
</del><ins>+        var tileSize = Math.round(this.size.height / 25);
</ins><span class="cx"> 
</span><span class="cx">         // Fill the scene with elements
</span><span class="cx">         var x = Math.round((this.size.width - tileSize) / 2);
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometertestsmasterresourcesparticlesjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/tests/master/resources/particles.js (197909 => 197910)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/tests/master/resources/particles.js        2016-03-10 01:38:03 UTC (rev 197909)
+++ trunk/PerformanceTests/Animometer/tests/master/resources/particles.js        2016-03-10 01:38:50 UTC (rev 197910)
</span><span class="lines">@@ -75,18 +75,6 @@
</span><span class="cx">         this.particles = [];
</span><span class="cx">     }, {
</span><span class="cx"> 
</span><del>-    initialize: function(benchmark)
-    {
-        Stage.prototype.initialize.call(this, benchmark);
-        this.emissionSpin = Stage.random(0, 3);
-        this.emitSteps = Stage.randomInt(4, 6);
-        this.emitLocation = [
-            new Point(this.size.x * .25, this.size.y * .333),
-            new Point(this.size.x * .5, this.size.y * .25),
-            new Point(this.size.x * .75, this.size.y * .333)
-        ];
-    },
-
</del><span class="cx">     animate: function(timeDelta)
</span><span class="cx">     {
</span><span class="cx">         timeDelta /= 4;
</span></span></pre></div>
<a id="trunkPerformanceTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/ChangeLog (197909 => 197910)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/ChangeLog        2016-03-10 01:38:03 UTC (rev 197909)
+++ trunk/PerformanceTests/ChangeLog        2016-03-10 01:38:50 UTC (rev 197910)
</span><span class="lines">@@ -1,5 +1,31 @@
</span><span class="cx"> 2016-03-09  Jon Lee  &lt;jonlee@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Enhance existing Animometer tests
+        https://bugs.webkit.org/show_bug.cgi?id=155261
+
+        Reviewed by Simon Fraser.
+
+        * Animometer/tests/master/resources/canvas-tests.js: Add a gradient to
+        the filled circles. To expose more of the gradient, add another circle.
+        (SimpleCanvasStage.call.animate): For each frame, create a gradient with
+        undulating stop points and colors. Fill the circles twice; once with
+        the solid color, and once with the gradient.
+
+        * Animometer/tests/master/resources/dom-particles.js: Refactor the
+        emission variables into a separate stage for this test. Add a colorOffset
+        variable to make the colors of each particle slightly different, since
+        the ramp controller can add large numbers of particles all at once, which
+        would otherwise get all the same color.
+        * Animometer/tests/master/resources/particles.js:
+        (initialize): Remove the code specific to the SVG mask test.
+
+        * Animometer/tests/master/resources/image-data.js:
+        (initialize): Remove unused local variable.
+        * Animometer/tests/master/resources/multiply.js:
+        (initialize): Make the test harder by adding more total particles.
+
+2016-03-09  Jon Lee  &lt;jonlee@apple.com&gt;
+
</ins><span class="cx">         Add text tests
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=155257
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>