Fix SVG benchmark test
https://bugs.webkit.org/show_bug.cgi?id=156410
Reviewed by Dean Jackson.
* Animometer/resources/extensions.js: Update Point.zero to be a static Point.
* Animometer/tests/simple/resources/tiled-canvas-image.js:
(Stage.call._setupTiles): Refactor.
* Animometer/tests/master/resources/particles.js:
(Particle.prototype.reset): Use Point.center.
(complexity): We are not using a gradient background anymore, so remove the +1.
* Animometer/tests/master/resources/svg-particles.js: Update to use SVG transform
instead of CSS transform.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@199244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/PerformanceTests/Animometer/resources/extensions.js b/PerformanceTests/Animometer/resources/extensions.js
index 1806670..d81dd79 100644
--- a/PerformanceTests/Animometer/resources/extensions.js
+++ b/PerformanceTests/Animometer/resources/extensions.js
@@ -286,10 +286,7 @@
});
Utilities.extendObject(Point, {
- zero: function()
- {
- return new Point(0, 0);
- },
+ zero: new Point(0, 0),
pointOnCircle: function(angle, radius)
{
diff --git a/PerformanceTests/Animometer/tests/master/resources/particles.js b/PerformanceTests/Animometer/tests/master/resources/particles.js
index 1de3e78..cf474e4 100644
--- a/PerformanceTests/Animometer/tests/master/resources/particles.js
+++ b/PerformanceTests/Animometer/tests/master/resources/particles.js
@@ -15,7 +15,7 @@
{
var randSize = Math.round(Math.pow(Pseudo.random(), 4) * this.sizeRange + this.sizeMinimum);
this.size = new Point(randSize, randSize);
- this.minPosition = this.size.multiply(.5);
+ this.minPosition = this.size.center;
this.maxPosition = this.stage.size.subtract(this.minPosition);
},
@@ -107,7 +107,6 @@
complexity: function()
{
- // We add one to represent the gradient background.
- return this.particles.length + 1;
+ return this.particles.length;
}
});
diff --git a/PerformanceTests/Animometer/tests/master/resources/svg-particles.js b/PerformanceTests/Animometer/tests/master/resources/svg-particles.js
index 91ae8b7..2ce24b5 100644
--- a/PerformanceTests/Animometer/tests/master/resources/svg-particles.js
+++ b/PerformanceTests/Animometer/tests/master/resources/svg-particles.js
@@ -42,9 +42,9 @@
if (this.isClipPath) {
this.element.setAttribute("width", this.size.x);
this.element.setAttribute("height", this.size.y);
- this.transformSuffix = "translate(-" + (this.size.x >> 1) + "px,-" + (this.size.y >> 1) + "px)";
+ this.transformSuffix = " translate(-" + this.size.center.x + ",-" + this.size.center.y + ")";
} else
- this.transformSuffix = "scale(" + this.size.x + ")translate(-.5px,-.5px)";
+ this.transformSuffix = " scale(" + this.size.x + ") translate(-.5,-.5)";
this.stage.colorOffset = (this.stage.colorOffset + .5) % 360;
@@ -59,7 +59,7 @@
move: function()
{
- this.element.style.transform = "translate(" + this.position.x + "px," + this.position.y + "px)" + this.rotater.rotateZ() + this.transformSuffix;
+ this.element.setAttribute("transform", "translate(" + this.position.x + "," + this.position.y + ") " + this.rotater.rotate(Point.zero) + this.transformSuffix);
}
});
diff --git a/PerformanceTests/Animometer/tests/simple/resources/tiled-canvas-image.js b/PerformanceTests/Animometer/tests/simple/resources/tiled-canvas-image.js
index 806b3c4..f5d02b6 100644
--- a/PerformanceTests/Animometer/tests/simple/resources/tiled-canvas-image.js
+++ b/PerformanceTests/Animometer/tests/simple/resources/tiled-canvas-image.js
@@ -41,7 +41,7 @@
this._tiles = new Array(maxTilesPerRow * maxTilesPerCol);
- var source = Point.zero();
+ var source = Point.zero;
for (var index = 0; index < this._tiles.length; ++index) {
this._tiles[index] = new CanvasImageTile(this, source);
source = this._nextTilePosition(source);
diff --git a/PerformanceTests/ChangeLog b/PerformanceTests/ChangeLog
index b5ad86e..1d503cc 100644
--- a/PerformanceTests/ChangeLog
+++ b/PerformanceTests/ChangeLog
@@ -1,3 +1,19 @@
+2016-04-08 Jon Lee <jonlee@apple.com>
+
+ Fix SVG benchmark test
+ https://bugs.webkit.org/show_bug.cgi?id=156410
+
+ Reviewed by Dean Jackson.
+
+ * Animometer/resources/extensions.js: Update Point.zero to be a static Point.
+ * Animometer/tests/simple/resources/tiled-canvas-image.js:
+ (Stage.call._setupTiles): Refactor.
+ * Animometer/tests/master/resources/particles.js:
+ (Particle.prototype.reset): Use Point.center.
+ (complexity): We are not using a gradient background anymore, so remove the +1.
+ * Animometer/tests/master/resources/svg-particles.js: Update to use SVG transform
+ instead of CSS transform.
+
2016-04-06 Jon Lee <jonlee@apple.com>
Update master benchmark with SVG test