cleanup of performance improvement

This commit is contained in:
jdescottes
2014-07-03 00:48:49 +02:00
parent a2e2459169
commit fa626532ba
5 changed files with 34 additions and 28 deletions

View File

@ -10,7 +10,6 @@
// I apologize to my future self for this one.
var NO_SCROLL_MAX_COLORS = 20;
var MAX_COLORS = 100;
ns.PalettesListController = function (paletteController, usedColorService) {
this.usedColorService = usedColorService;
@ -80,8 +79,8 @@
}
}
if (colors.length > MAX_COLORS) {
colors = colors.slice(0, MAX_COLORS);
if (colors.length > Constants.MAX_CURRENT_COLORS_DISPLAYED) {
colors = colors.slice(0, Constants.MAX_CURRENT_COLORS_DISPLAYED);
}
return colors;

View File

@ -16,9 +16,9 @@
this.redrawFlag = true;
this.cachedImageProcessor = new pskl.model.frame.CachedFrameProcessor();
this.cachedImageProcessor.setFrameProcessor(this.frameToPreviewCanvas_.bind(this));
this.cachedImageProcessor.setOutputCloner(this.clonePreviewCanvas_.bind(this));
this.cachedFrameProcessor = new pskl.model.frame.CachedFrameProcessor();
this.cachedFrameProcessor.setFrameProcessor(this.frameToPreviewCanvas_.bind(this));
this.cachedFrameProcessor.setOutputCloner(this.clonePreviewCanvas_.bind(this));
};
ns.PreviewFilmController.prototype.init = function() {
@ -207,7 +207,7 @@
};
ns.PreviewFilmController.prototype.getCanvasForFrame = function (frame) {
var canvas = this.cachedImageProcessor.get(frame, this.zoom);
var canvas = this.cachedFrameProcessor.get(frame, this.zoom);
canvas.classList.add('tile-view', 'canvas');
return canvas;
};