draw events no longer bubble. It was causing too much of a performance hit, and didn't provide a whole lot of value. Now, only layers fire draw events

This commit is contained in:
Eric Rowell
2013-08-09 20:22:51 -07:00
parent 992be5dd2e
commit 7700ecc70b
6 changed files with 58 additions and 38 deletions

View File

@@ -8,7 +8,7 @@
<li><a href="functionalTests.html">Functional Tests (171)</a></li>
<li><a href="visualTests.html">Visual Tests (46)</a></li>
<li><a href="manualTests.html">Manual Tests</a></li>
<li><a href="visualTests.html">Performance Tests</a></li>
<li><a href="performanceTests.html">Performance Tests</a></li>
<li><a href="special/index.html">Special Tests</a></li>
</ul>
</body>

View File

@@ -9,21 +9,6 @@
<!-- versions -->
<script src="http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.4.3.js"></script>
<script>
run(Kinetic);
</script>
<script src="http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.5.0.min.js"></script>
<script>
run(Kinetic);
</script>
<script src="http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.5.1.min.js"></script>
<script>
run(Kinetic);
</script>
<script src="http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.5.2.min.js"></script>
<script>
run(Kinetic);
@@ -34,6 +19,16 @@
run(Kinetic);
</script>
<script src="http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.5.4.min.js"></script>
<script>
run(Kinetic);
</script>
<script src="http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.5.5.min.js"></script>
<script>
run(Kinetic);
</script>
<script src="../../dist/kinetic-dev.js"></script>
<script>
run(Kinetic);

View File

@@ -11,7 +11,8 @@ function stop(build, test) {
}
var tests = {
'render 20,000 circles': function(Kinetic, container, test) {
/*
'render 2,000 circles': function(Kinetic, container, test) {
start();
var stage = new Kinetic.Stage({
width: 500,
@@ -21,7 +22,7 @@ var tests = {
var layer = new Kinetic.Layer();
for (var n=0; n<20000; n++) {
for (var n=0; n<2000; n++) {
var circle = new Kinetic.Circle({
x: Math.random() * 500,
y: Math.random() * 200,
@@ -35,6 +36,36 @@ var tests = {
}
stage.add(layer);
stop(Kinetic, test);
}
*/
'render one circle 2,000 times': function(Kinetic, container, test) {
start();
var stage = new Kinetic.Stage({
width: 500,
height: 200,
container: container
});
var layer = new Kinetic.Layer();
var circle = new Kinetic.Circle({
x: Math.random() * 500,
y: Math.random() * 200,
radius: 40,
fill: 'red',
stroke: 'black',
strokeWidth: 3
});
layer.add(circle);
stage.add(layer);
for (var n=0; n<2000; n++) {
layer.draw();
}
stop(Kinetic, test);
}
};