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

View File

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

View File

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