Merge pull request #6004 from yurydelendik/print-raf

Bug 1163404 - Disables rAF for the printing.
This commit is contained in:
Brendan Dahl 2015-05-12 10:54:31 -07:00
commit d87c1ecc2b

View File

@ -740,6 +740,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
this.commonObjs, this.commonObjs,
intentState.operatorList, intentState.operatorList,
this.pageNumber); this.pageNumber);
internalRenderTask.useRequestAnimationFrame = renderingIntent !== 'print';
if (!intentState.renderTasks) { if (!intentState.renderTasks) {
intentState.renderTasks = []; intentState.renderTasks = [];
} }
@ -1555,6 +1556,7 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
this.running = false; this.running = false;
this.graphicsReadyCallback = null; this.graphicsReadyCallback = null;
this.graphicsReady = false; this.graphicsReady = false;
this.useRequestAnimationFrame = false;
this.cancelled = false; this.cancelled = false;
this.capability = createPromiseCapability(); this.capability = createPromiseCapability();
this.task = new RenderTask(this); this.task = new RenderTask(this);
@ -1628,7 +1630,11 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
}, },
_scheduleNext: function InternalRenderTask__scheduleNext() { _scheduleNext: function InternalRenderTask__scheduleNext() {
window.requestAnimationFrame(this._nextBound); if (this.useRequestAnimationFrame) {
window.requestAnimationFrame(this._nextBound);
} else {
Promise.resolve(undefined).then(this._nextBound);
}
}, },
_next: function InternalRenderTask__next() { _next: function InternalRenderTask__next() {