mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Reduce the memory usage of the operator list.
This commit is contained in:
parent
a6e7f2226a
commit
f4942b11f8
8 changed files with 288 additions and 155 deletions
|
@ -481,10 +481,10 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
|
|||
*/
|
||||
_renderPageChunk: function PDFPageProxy_renderPageChunk(operatorListChunk) {
|
||||
// Add the new chunk to the current operator list.
|
||||
Util.concatenateToArray(this.operatorList.fnArray,
|
||||
operatorListChunk.fnArray);
|
||||
Util.concatenateToArray(this.operatorList.argsArray,
|
||||
operatorListChunk.argsArray);
|
||||
for (var i = 0, ii = operatorListChunk.length; i < ii; i++) {
|
||||
this.operatorList.fnArray.push(operatorListChunk.fnArray[i]);
|
||||
this.operatorList.argsArray.push(operatorListChunk.argsArray[i]);
|
||||
}
|
||||
this.operatorList.lastChunk = operatorListChunk.lastChunk;
|
||||
|
||||
// Notify all the rendering tasks there are more operators to be consumed.
|
||||
|
@ -1094,7 +1094,7 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
|
|||
this.operatorListIdx,
|
||||
this._continue.bind(this),
|
||||
this.stepper);
|
||||
if (this.operatorListIdx === this.operatorList.fnArray.length) {
|
||||
if (this.operatorListIdx === this.operatorList.argsArray.length) {
|
||||
this.running = false;
|
||||
if (this.operatorList.lastChunk) {
|
||||
this.gfx.endDrawing();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue