From ecfd77fa7a782c9c0f34361479ef9d9903444441 Mon Sep 17 00:00:00 2001 From: Eric Rowell Date: Mon, 9 Dec 2013 23:00:26 -0800 Subject: [PATCH] updated perf tests --- test/performance/common/random-squares.js | 25 ++++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/test/performance/common/random-squares.js b/test/performance/common/random-squares.js index e468a67d..d56166c8 100644 --- a/test/performance/common/random-squares.js +++ b/test/performance/common/random-squares.js @@ -44,7 +44,7 @@ colorIndex = 0; } - var shape = make_shape(color); + var shape = make_shape('red'); circlesLayer.add(shape); circles.push(shape); }()); @@ -66,7 +66,12 @@ for (var i = 0; i < circles.length; i++) { var x = Math.random() * width; var y = Math.random() * height; + if (VERSION === 'new') { circles[i].setPosition({x: x, y: y}); + } + else { + circles[i].setPosition(x, y); + } } lastTime = time; @@ -80,14 +85,14 @@ function make_shape(color) { if (VERSION === 'new') { - return new Kinetic.Rect({ - fill: color, - width: 10, - height: 10 - }); + // return new Kinetic.Rect({ + // fill: color, + // width: 10, + // height: 10 + // }); - /* + return new Kinetic.Shape({ drawFunc: function(context) { var _context = context._context; @@ -98,7 +103,7 @@ _context.fill(); } }); - */ + } else { return new Kinetic.Shape(function(){ @@ -117,8 +122,8 @@ if (VERSION === 'new') { stage = new Kinetic.Stage({ container: "container", - width: 578, - height: 200, + width: width, + height: height, nestedTransformsEnabled: false }); circlesLayer = new Kinetic.Layer({