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 68c2f38c20fef6c527f50bdeddcc8181479a0fba..25c5700bf0d0d5722fc2ee70c1e56d33ed25dc36 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 5e12e9f7dbf0c9a500b4ddb54ee47d01ec1252c7..11f8920c5b45c0cf4df401d1465816326ca4ad94 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 343fa34f8225363d2ae51e66613e240b44e91143..c9028d791092324d3667a167d1f393b88758cb68 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 1920f9b070ef7df47fbaf02ad3cdc57ce5372558..393d79fc73e3d4750f795a3adc66702593916855 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 b616c1e32247ace75fc797302fe127e44d33e20a..385e1976bce92804ac76c2b482b3d5b02ce6bbbc 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 d6d29fad0351f991bd06f3a56fcccd255d27c458..ef1d64c5f3f6741a5f755139653baea78e4ed7d5 100644 (file)
@@ -1,3 +1,28 @@
+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