optimize tng for disposeOp=2.

This commit is contained in:
Christopher Jeffrey 2015-07-18 15:18:57 -07:00
parent d2a2847506
commit 1d05e3d265
1 changed files with 11 additions and 7 deletions

18
vendor/tng.js vendored
View File

@ -932,14 +932,18 @@ PNG.prototype.renderFrame = function(bmp, frame, i) {
}
}
this._lastBmp = [];
for (y = 0; y < frame.fctl.height; y++) {
line = [];
for (x = 0; x < frame.fctl.width; x++) {
p = this._curBmp[yo + y][xo + x];
line.push({ r: p.r, g: p.g, b: p.b, a: p.a });
if (frame.fctl.disposeOp === 2) {
this._lastBmp = [];
for (y = 0; y < frame.fctl.height; y++) {
line = [];
for (x = 0; x < frame.fctl.width; x++) {
p = this._curBmp[yo + y][xo + x];
line.push({ r: p.r, g: p.g, b: p.b, a: p.a });
}
this._lastBmp.push(line);
}
this._lastBmp.push(line);
} else {
this._lastBmp = null;
}
for (y = 0; y < frame.fctl.height; y++) {