you can now cache regions of a node outside of the stage viewport. added more unit tests

This commit is contained in:
Eric Rowell
2012-07-21 15:38:25 -07:00
parent d74ec8ab06
commit f1cb695e1f
8 changed files with 176 additions and 102 deletions

View File

@@ -124,22 +124,24 @@ Test.prototype.tests = {
stage.add(layer);
console.log('call toImage')
star.toImage(function(img) {
startTimer();
for(var n = 0; n < 1000; n++) {
var image = new Kinetic.Image({
image: img,
x: Math.random() * stage.getWidth(),
y: Math.random() * stage.getHeight(),
offset: 70
});
star.toImage({
callback: function(img) {
startTimer();
for(var n = 0; n < 1000; n++) {
var image = new Kinetic.Image({
image: img,
x: Math.random() * stage.getWidth(),
y: Math.random() * stage.getHeight(),
offset: 70
});
layer.add(image);
layer.add(image);
}
layer.draw();
endTimer('draw 1,000 cached stars');
}
layer.draw();
endTimer('draw 1,000 cached stars');
});
}
};