updated perf tests

This commit is contained in:
Eric Rowell
2013-12-09 23:00:26 -08:00
parent 8b4deb004d
commit ecfd77fa7a

View File

@@ -44,7 +44,7 @@
colorIndex = 0; colorIndex = 0;
} }
var shape = make_shape(color); var shape = make_shape('red');
circlesLayer.add(shape); circlesLayer.add(shape);
circles.push(shape); circles.push(shape);
}()); }());
@@ -66,7 +66,12 @@
for (var i = 0; i < circles.length; i++) { for (var i = 0; i < circles.length; i++) {
var x = Math.random() * width; var x = Math.random() * width;
var y = Math.random() * height; var y = Math.random() * height;
if (VERSION === 'new') {
circles[i].setPosition({x: x, y: y}); circles[i].setPosition({x: x, y: y});
}
else {
circles[i].setPosition(x, y);
}
} }
lastTime = time; lastTime = time;
@@ -80,14 +85,14 @@
function make_shape(color) { function make_shape(color) {
if (VERSION === 'new') { if (VERSION === 'new') {
return new Kinetic.Rect({ // return new Kinetic.Rect({
fill: color, // fill: color,
width: 10, // width: 10,
height: 10 // height: 10
}); // });
/*
return new Kinetic.Shape({ return new Kinetic.Shape({
drawFunc: function(context) { drawFunc: function(context) {
var _context = context._context; var _context = context._context;
@@ -98,7 +103,7 @@
_context.fill(); _context.fill();
} }
}); });
*/
} else { } else {
return new Kinetic.Shape(function(){ return new Kinetic.Shape(function(){
@@ -117,8 +122,8 @@
if (VERSION === 'new') { if (VERSION === 'new') {
stage = new Kinetic.Stage({ stage = new Kinetic.Stage({
container: "container", container: "container",
width: 578, width: width,
height: 200, height: height,
nestedTransformsEnabled: false nestedTransformsEnabled: false
}); });
circlesLayer = new Kinetic.Layer({ circlesLayer = new Kinetic.Layer({