From 9479b214fab5e2a0576c737d2527fca886b03d9c Mon Sep 17 00:00:00 2001 From: Francisco Dans Date: Wed, 25 Feb 2015 12:42:21 +0100 Subject: [PATCH] initialises layers JIT, instead of in the constructor --- lib/torque/renderer/ball.js | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/torque/renderer/ball.js b/lib/torque/renderer/ball.js index c244534..8c6d739 100644 --- a/lib/torque/renderer/ball.js +++ b/lib/torque/renderer/ball.js @@ -10,8 +10,7 @@ function BallRenderer(thecanvas){ this.width = this.canvas.width; this.height = this.canvas.height; this.size = this.width * this.height; - this.pointList = new Uint8ClampedArray(this.size * 4); - this.contourLayer = new Uint8ClampedArray(this.size * 4); + this.pointLayer = new Uint8ClampedArray(this.size * 4); this.radius = 30; this.drawnTemp = []; this.prof = 0; @@ -72,24 +71,28 @@ BallRenderer.prototype = { } a[a.length-1] = 255; var l = -step/2; + var gradient = new Uint8ClampedArray(1024); for(var i = 0; i