Refactor tune() to not return the complexity of the scene.
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Feb 2016 03:30:38 +0000 (03:30 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Feb 2016 03:30:38 +0000 (03:30 +0000)
We have stage.complexity() now, so returning the complexity through tune
is unnecessary.

* Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
* Animometer/tests/master/resources/canvas-stage.js:
* Animometer/tests/master/resources/particles.js:
* Animometer/tests/misc/resources/canvas-electrons.js:
* Animometer/tests/misc/resources/canvas-stars.js:
* Animometer/tests/resources/main.js:
* Animometer/tests/simple/resources/simple-canvas.js:
* Animometer/tests/simple/resources/tiled-canvas-image.js:
* Animometer/tests/template/resources/template-canvas.js:
* Animometer/tests/template/resources/template-css.js:
* Animometer/tests/template/resources/template-svg.js:
* Animometer/tests/text/resources/layering-text.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196294 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-particles.js
PerformanceTests/Animometer/tests/master/resources/canvas-stage.js
PerformanceTests/Animometer/tests/master/resources/particles.js
PerformanceTests/Animometer/tests/misc/resources/canvas-electrons.js
PerformanceTests/Animometer/tests/misc/resources/canvas-stars.js
PerformanceTests/Animometer/tests/simple/resources/simple-canvas.js
PerformanceTests/Animometer/tests/simple/resources/tiled-canvas-image.js
PerformanceTests/Animometer/tests/template/resources/template-canvas.js
PerformanceTests/Animometer/tests/template/resources/template-css.js
PerformanceTests/Animometer/tests/template/resources/template-svg.js
PerformanceTests/Animometer/tests/text/resources/layering-text.js
PerformanceTests/ChangeLog

index 683dc2a..b923d43 100644 (file)
@@ -96,12 +96,12 @@ BouncingParticlesStage = Utilities.createSubclass(Stage,
     tune: function(count)
     {
         if (count == 0)
-            return this.particles.length;
+            return;
 
         if (count > 0) {
             for (var i = 0; i < count; ++i)
                 this.particles.push(this.createParticle());
-            return this.particles.length;
+            return;
         }
 
         count = Math.min(-count, this.particles.length);
@@ -112,7 +112,6 @@ BouncingParticlesStage = Utilities.createSubclass(Stage,
         }
 
         this.particles.splice(-count, count);
-        return this.particles.length;
     },
 
     complexity: function()
index e394f92..ae647db 100644 (file)
@@ -15,17 +15,16 @@ SimpleCanvasStage = Utilities.createSubclass(Stage,
     tune: function(count)
     {
         if (count == 0)
-            return this.objects.length;
+            return;
 
         if (count > 0) {
             for (var i = 0; i < count; ++i)
                 this.objects.push(new this._canvasObject(this));
-            return this.objects.length;
+            return;
         }
 
         count = Math.min(-count, this.objects.length);
         this.objects.splice(0, count);
-        return this.objects.length;
     },
 
     animate: function()
index 807d03c..69673c1 100644 (file)
@@ -107,12 +107,12 @@ ParticlesStage = Utilities.createSubclass(Stage,
     tune: function(count)
     {
         if (count == 0)
-            return this.particles.length;
+            return;
 
         if (count > 0) {
             for (var i = 0; i < count; ++i)
                 this.particles.push(this.createParticle());
-            return this.particles.length;
+            return;
         }
 
         count = Math.min(-count, this.particles.length);
@@ -123,7 +123,6 @@ ParticlesStage = Utilities.createSubclass(Stage,
         }
 
         this.particles.splice(0, count);
-        return this.particles.length;
     },
 
     complexity: function()
index 27865b6..6dc6e21 100644 (file)
@@ -70,18 +70,16 @@ CanvasElectronsStage = Utilities.createSubclass(Stage,
     tune: function(count)
     {
         if (count == 0)
-            return this._electrons.length;
+            return;
 
         if (count > 0) {
             for (var i = 0; i < count; ++i)
                 this._electrons.push(new CanvasElectron(this));
-            return this._electrons.length;
+            return;
         }
 
         count = Math.min(-count, this._electrons.length);
         this._electrons.splice(-count, count);
-
-        return this._electrons.length;
     },
 
     animate: function(timeDelta)
index dc8c0ca..27c9cc9 100644 (file)
@@ -67,18 +67,16 @@ CanvasStarsStage = Utilities.createSubclass(Stage,
     tune: function(count)
     {
         if (count == 0)
-            return this._objects.length;
+            return;
 
         if (count > 0) {
             for (var i = 0; i < count; ++i)
                 this._objects.push(new CanvasStar(this));
-            return this._objects.length;
+            return;
         }
 
         count = Math.min(-count, this._objects.length);
         this._objects.splice(-count, count);
-
-        return this._objects.length;
     },
 
     animate: function(timeDelta)
index 33cf6f0..28342a8 100644 (file)
@@ -2,7 +2,7 @@ Utilities.extendObject(SimpleCanvasStage.prototype, {
     tune: function(count)
     {
         if (count == 0)
-            return this.objects.length;
+            return;
 
         if (count > 0) {
             // For some tests, it may be easier to see how well the test is going
@@ -10,11 +10,10 @@ Utilities.extendObject(SimpleCanvasStage.prototype, {
             var coordinateMaximumFactor = Math.min(this.objects.length, Math.min(this.size.x, this.size.y)) / Math.min(this.size.x, this.size.y);
             for (var i = 0; i < count; ++i)
                 this.objects.push(new this._canvasObject(this, coordinateMaximumFactor));
-            return this.objects.length;
+            return;
         }
 
         count = Math.min(-count, this.objects.length);
         this.objects.splice(-count, count);
-        return this.objects.length;
     }
 });
index 4c7b421..806b3c4 100644 (file)
@@ -66,8 +66,6 @@ TiledCanvasImageStage = Utilities.createSubclass(Stage,
 
         this._ctiles = Math.max(this._ctiles, 0);
         this._ctiles = Math.min(this._ctiles, this._tiles.length);
-
-        return this._ctiles;
     },
 
     _drawBackground: function()
index 61a8af6..b74984c 100644 (file)
@@ -47,12 +47,6 @@ TemplateCanvasStage = Utilities.createSubclass(Stage,
         // the stage.
 
         // Change objects in the stage.
-
-        // Return the number of all the elements in the stage.
-        // This number is recorded in the sampled data.
-
-        // Return the count of the objects in the stage.
-        return 0;
     },
 
     animate: function(timeDelta)
index 430f415..cdaa814 100644 (file)
@@ -20,12 +20,6 @@ TemplateCssStage = Utilities.createSubclass(Stage,
         // the stage.
 
         // Change objects in the stage.
-
-        // Return the number of all the elements in the stage.
-        // This number is recorded in the sampled data.
-
-        // Return the count of the objects in the stage.
-        return 0;
     },
 
     animate: function(timeDelta)
index 23762c3..8fee9c3 100644 (file)
@@ -20,12 +20,6 @@ TemplateSvgStage = Utilities.createSubclass(Stage,
         // the stage.
 
         // TODO: Change objects in the stage.
-
-        // Return the number of all the elements in the stage.
-        // This number is recorded in the sampled data.
-
-        // TODO: Return the count of the objects in the stage.
-        return 0;
     },
 
     animate: function(timeDelta)
index 7f0f1c0..0da93cb 100644 (file)
@@ -100,19 +100,17 @@ LayeringTextStage = Utilities.createSubclass(Stage,
     tune: function(count)
     {
         if (count == 0)
-            return this._textElements.length;
+            return;
 
         if (count > 0) {
             for (var i = 0; i < count; ++i)
                 this._pushTextElement();
-            return this._textElements.length;
+            return;
         }
 
         count = Math.min(-count, this._textElements.length);
         for (var i = 0; i < count; ++i)
             this._popTextElement();
-
-        return this._textElements.length;
     },
 
     complexity: function()
index 29c8e19..35b88c4 100644 (file)
@@ -1,5 +1,25 @@
 2016-02-07  Jon Lee  <jonlee@apple.com>
 
+        Refactor tune() to not return the complexity of the scene.
+
+        We have stage.complexity() now, so returning the complexity through tune
+        is unnecessary.
+
+        * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
+        * Animometer/tests/master/resources/canvas-stage.js:
+        * Animometer/tests/master/resources/particles.js:
+        * Animometer/tests/misc/resources/canvas-electrons.js:
+        * Animometer/tests/misc/resources/canvas-stars.js:
+        * Animometer/tests/resources/main.js:
+        * Animometer/tests/simple/resources/simple-canvas.js:
+        * Animometer/tests/simple/resources/tiled-canvas-image.js:
+        * Animometer/tests/template/resources/template-canvas.js:
+        * Animometer/tests/template/resources/template-css.js:
+        * Animometer/tests/template/resources/template-svg.js:
+        * Animometer/tests/text/resources/layering-text.js:
+
+2016-02-07  Jon Lee  <jonlee@apple.com>
+
         Make the fixed controller a step controller instead. Halfway through the test
         it will bump up the complexity 4-fold. Calculate the step timestamp using options
         instead of a separate parameter to the Controller constructor.