Refactor tune() to pass in an integer-based count
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Oct 2015 00:11:16 +0000 (00:11 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Oct 2015 00:11:16 +0000 (00:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150060
<rdar://problem/23079425>

Reviewed by Dean Jackson.

All of the tune functions do an initial step of flooring the
# of painting objects to add or remove. Factor that out since
the complexity of all of these tests is always expressed in terms
of countable items.

* Animometer/tests/resources/main.js:
(Benchmark.prototype.update): Update the tuneValue.

* Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
(BouncingParticlesStage.prototype.tune): Remove the count adjustment.
* Animometer/tests/examples/resources/canvas-electrons.js:
(CanvasElectronsStage.prototype.tune): Ditto.
* Animometer/tests/examples/resources/canvas-stars.js:
(CanvasStarsStage.prototype.tune): Ditto.
* Animometer/tests/text/resources/layering-text.js:
(LayeringTextStage.prototype.tune): Ditto.

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

PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-particles.js
PerformanceTests/Animometer/tests/examples/resources/canvas-electrons.js
PerformanceTests/Animometer/tests/examples/resources/canvas-stars.js
PerformanceTests/Animometer/tests/resources/main.js
PerformanceTests/Animometer/tests/text/resources/layering-text.js
PerformanceTests/ChangeLog

index 68c2f38..25c5700 100644 (file)
@@ -95,8 +95,6 @@ BouncingParticlesStage.prototype.animate = function(timeDelta)
     
 BouncingParticlesStage.prototype.tune = function(count)
 {
-    count = count > 0 ? Math.floor(count) : Math.ceil(count);
-
     if (count == 0)
         return this._particles.length;
 
index 5e12e9f..11f8920 100644 (file)
@@ -60,8 +60,6 @@ CanvasElectronsStage.prototype.constructor = CanvasElectronsStage;
 
 CanvasElectronsStage.prototype.tune = function(count)
 {
-    count = count > 0 ? Math.floor(count) : Math.ceil(count);
-
     if (count == 0)
         return this._electrons.length;
 
index 343fa34..c9028d7 100644 (file)
@@ -61,8 +61,6 @@ CanvasStarsStage.prototype.constructor = CanvasStarsStage;
 
 CanvasStarsStage.prototype.tune = function(count)
 {
-    count = count > 0 ? Math.floor(count) : Math.ceil(count);
-
     if (count == 0)
         return this._objects.length;
 
index 1920f9b..393d79f 100644 (file)
@@ -183,6 +183,7 @@ Benchmark.prototype =
             // The relationship between frameRate and test complexity is inverse-proportional so we
             // need to use the negative of PIDController.tune() to change the complexity of the test.
             tuneValue = -this._controller.tune(currentFrameRate, timeDelta / 1000);
+            tuneValue = tuneValue > 0 ? Math.floor(tuneValue) : Math.ceil(tuneValue);
         }
 
         var currentComplexity = this.tune(tuneValue);
index b616c1e..385e197 100644 (file)
@@ -220,8 +220,6 @@ LayeringTextStage.prototype.animate = function(timeDelta)
 
 LayeringTextStage.prototype.tune = function(count)
 {
-    count = count > 0 ? Math.floor(count) : Math.ceil(count);
-
     if (count == 0)
         return this._textElements.length;
 
index d6d29fa..ef1d64c 100644 (file)
@@ -1,5 +1,30 @@
 2015-10-12  Jon Lee  <jonlee@apple.com>
 
+        Refactor tune() to pass in an integer-based count
+        https://bugs.webkit.org/show_bug.cgi?id=150060
+        <rdar://problem/23079425>
+
+        Reviewed by Dean Jackson.
+
+        All of the tune functions do an initial step of flooring the
+        # of painting objects to add or remove. Factor that out since
+        the complexity of all of these tests is always expressed in terms
+        of countable items.
+
+        * Animometer/tests/resources/main.js:
+        (Benchmark.prototype.update): Update the tuneValue.
+
+        * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
+        (BouncingParticlesStage.prototype.tune): Remove the count adjustment.
+        * Animometer/tests/examples/resources/canvas-electrons.js:
+        (CanvasElectronsStage.prototype.tune): Ditto.
+        * Animometer/tests/examples/resources/canvas-stars.js:
+        (CanvasStarsStage.prototype.tune): Ditto.
+        * Animometer/tests/text/resources/layering-text.js:
+        (LayeringTextStage.prototype.tune): Ditto.
+
+2015-10-12  Jon Lee  <jonlee@apple.com>
+
         Store test-interval in localStorage
         https://bugs.webkit.org/show_bug.cgi?id=150055
         <rdar://problem/23078879>