Format some code and remove unnecessary logging

This commit is contained in:
Dávid Szabó 2016-08-24 23:10:59 +02:00 committed by Julian Descottes
parent 0bbb4ff2d5
commit 712262b82a
3 changed files with 15 additions and 13 deletions

View File

@ -41,7 +41,6 @@
frame.setPixels(buffer);
return frame;
} else {
console.error(pixels);
throw 'Bad arguments in pskl.model.Frame.fromPixelGrid';
}
};
@ -95,7 +94,6 @@
ns.Frame.prototype.clear = function () {
this.pixels = ns.Frame.createEmptyPixelGrid_(this.getWidth(), this.getHeight());
this.version++;
// this.setPixels(pixels);
};
/**
@ -103,9 +101,6 @@
* @private
*/
ns.Frame.prototype.clonePixels_ = function (pixels) {
//npixels = new Uint32Array(pixels.length);
//npixels.set(pixels);
return new Uint32Array(pixels);
};

View File

@ -35,16 +35,20 @@
var callbackFirstLvlCacheOnly = this.onProcessorComplete_.bind(this, deferred, cache, key1/*, key1*/);
this.frameProcessor(frame, callbackFirstLvlCacheOnly);
} else {
// TODO: Remove?
/*var framePixels = new Float64Array(frame.pixels.buffer).toString();
// TODO: Remove? or offload to worker
/*
var framePixels = new Float64Array(frame.pixels.buffer).toString();
var key2 = pskl.utils.hashCode(framePixels);
if (cache[key2]) {
processedFrame = this.outputCloner(cache[key2], frame);
cache[key1] = processedFrame;
} else {*/
var callback = this.onProcessorComplete_.bind(this, deferred, cache, key1/*, key1*/);
this.frameProcessor(frame, callback);/*
}*/
} else {
*/
var callback = this.onProcessorComplete_.bind(this, deferred, cache, key1/*, key1*/);
this.frameProcessor(frame, callback);
/*
}
*/
}
if (processedFrame) {

View File

@ -80,10 +80,13 @@
this.cacheHitLvl2_++;
processedFrame = this.outputCloner(cache[frameAsString], frame);
} else {
*/processedFrame = this.frameProcessor(frame);/*
*/
processedFrame = this.frameProcessor(frame);
/*
cache[frameAsString] = processedFrame;
}
cache[cacheKey] = processedFrame;*/
cache[cacheKey] = processedFrame;
*/
}
return processedFrame;