Cleanup the way getIRQueue is called (no need to pass in a queue object in most cases anymore)
This commit is contained in:
parent
c57349a927
commit
1c87b63124
@ -213,9 +213,8 @@ var Page = (function PageClosure() {
|
|||||||
|
|
||||||
var pe = this.pe = new PartialEvaluator(
|
var pe = this.pe = new PartialEvaluator(
|
||||||
xref, handler, 'p' + this.pageNumber + '_');
|
xref, handler, 'p' + this.pageNumber + '_');
|
||||||
var IRQueue = {};
|
|
||||||
this.IRQueue = pe.getIRQueue(content, resources, IRQueue, dependency);
|
|
||||||
|
|
||||||
|
this.IRQueue = pe.getIRQueue(content, resources, dependency);
|
||||||
this.stats.timeEnd('Build IR Queue');
|
this.stats.timeEnd('Build IR Queue');
|
||||||
return this.IRQueue;
|
return this.IRQueue;
|
||||||
},
|
},
|
||||||
|
@ -113,7 +113,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
|
|
||||||
PartialEvaluator.prototype = {
|
PartialEvaluator.prototype = {
|
||||||
getIRQueue: function partialEvaluatorGetIRQueue(stream, resources,
|
getIRQueue: function partialEvaluatorGetIRQueue(stream, resources,
|
||||||
queue, dependency) {
|
dependency, queue) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var xref = this.xref;
|
var xref = this.xref;
|
||||||
@ -136,8 +136,6 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
|
|
||||||
var fontRes = resources.get('Font');
|
var fontRes = resources.get('Font');
|
||||||
|
|
||||||
// TODO: TOASK: Is it possible to get here? If so, what does
|
|
||||||
// args[0].name should be like???
|
|
||||||
assert(fontRes, 'fontRes not available');
|
assert(fontRes, 'fontRes not available');
|
||||||
|
|
||||||
fontRes = xref.fetchIfRef(fontRes);
|
fontRes = xref.fetchIfRef(fontRes);
|
||||||
@ -177,7 +175,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
|
|
||||||
// Ensure the font is ready before the font is set
|
// Ensure the font is ready before the font is set
|
||||||
// and later on used for drawing.
|
// and later on used for drawing.
|
||||||
// TODO: This should get insert to the IRQueue only once per
|
// OPTIMIZE: This should get insert to the IRQueue only once per
|
||||||
// page.
|
// page.
|
||||||
insertDependency([loadedName]);
|
insertDependency([loadedName]);
|
||||||
return loadedName;
|
return loadedName;
|
||||||
@ -239,6 +237,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
}, handler, xref, resources, image, inline);
|
}, handler, xref, resources, image, inline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!queue)
|
||||||
|
queue = {};
|
||||||
|
|
||||||
if (!queue.argsArray) {
|
if (!queue.argsArray) {
|
||||||
queue.argsArray = [];
|
queue.argsArray = [];
|
||||||
}
|
}
|
||||||
@ -295,9 +296,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
if (typeNum == TILING_PATTERN) {
|
if (typeNum == TILING_PATTERN) {
|
||||||
// Create an IR of the pattern code.
|
// Create an IR of the pattern code.
|
||||||
var depIdx = dependencyArray.length;
|
var depIdx = dependencyArray.length;
|
||||||
var queueObj = {};
|
|
||||||
var codeIR = this.getIRQueue(pattern, dict.get('Resources') ||
|
var codeIR = this.getIRQueue(pattern, dict.get('Resources') ||
|
||||||
resources, queueObj, dependencyArray);
|
resources, dependencyArray);
|
||||||
|
|
||||||
// Add the dependencies that are required to execute the
|
// Add the dependencies that are required to execute the
|
||||||
// codeIR.
|
// codeIR.
|
||||||
@ -340,8 +340,11 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
// This adds the IRQueue of the xObj to the current queue.
|
// This adds the IRQueue of the xObj to the current queue.
|
||||||
var depIdx = dependencyArray.length;
|
var depIdx = dependencyArray.length;
|
||||||
|
|
||||||
|
// Pass in the current `queue` object. That means the `fnArray`
|
||||||
|
// and the `argsArray` in this scope is reused and new commands
|
||||||
|
// are added to them.
|
||||||
this.getIRQueue(xobj, xobj.dict.get('Resources') || resources,
|
this.getIRQueue(xobj, xobj.dict.get('Resources') || resources,
|
||||||
queue, dependencyArray);
|
dependencyArray, queue);
|
||||||
|
|
||||||
// Add the dependencies that are required to execute the
|
// Add the dependencies that are required to execute the
|
||||||
// codeIR.
|
// codeIR.
|
||||||
@ -454,10 +457,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return queue;
|
||||||
fnArray: fnArray,
|
|
||||||
argsArray: argsArray
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
|
||||||
extractDataStructures: function
|
extractDataStructures: function
|
||||||
@ -858,9 +858,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
properties.charProcIRQueues = {};
|
properties.charProcIRQueues = {};
|
||||||
for (var key in charProcs.map) {
|
for (var key in charProcs.map) {
|
||||||
var glyphStream = xref.fetchIfRef(charProcs.map[key]);
|
var glyphStream = xref.fetchIfRef(charProcs.map[key]);
|
||||||
var queueObj = {};
|
|
||||||
properties.charProcIRQueues[key] =
|
properties.charProcIRQueues[key] =
|
||||||
this.getIRQueue(glyphStream, fontResources, queueObj, dependency);
|
this.getIRQueue(glyphStream, fontResources, dependency);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user