mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Replace the PDFJS.disableWebGL
option with a enableWebGL
option passed, via BaseViewer
/PDFPageView
, to PDFPageProxy.render
Please note that the, pre-existing, viewer preference is already named `enableWebGL`; fixes 4919.
This commit is contained in:
parent
a1cfa5f4d7
commit
77efed6626
6 changed files with 16 additions and 15 deletions
|
@ -707,6 +707,8 @@ var PDFDocumentProxy = (function PDFDocumentProxyClosure() {
|
|||
* calling of PDFPage.getViewport method.
|
||||
* @property {string} intent - Rendering intent, can be 'display' or 'print'
|
||||
* (default value is 'display').
|
||||
* @property {boolean} enableWebGL - (optional) Enables WebGL accelerated
|
||||
* rendering for some operations. The default value is `false`.
|
||||
* @property {boolean} renderInteractiveForms - (optional) Whether or not
|
||||
* interactive form elements are rendered in the display
|
||||
* layer. If so, we do not render them on canvas as well.
|
||||
|
@ -828,9 +830,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
|
|||
var renderingIntent = (params.intent === 'print' ? 'print' : 'display');
|
||||
var canvasFactory = params.canvasFactory || new DOMCanvasFactory();
|
||||
let webGLContext = new WebGLContext({
|
||||
// TODO: When moving this parameter from `PDFJS` to {RenderParameters},
|
||||
// change its name to `enableWebGL` instead.
|
||||
enable: !getDefaultSetting('disableWebGL'),
|
||||
enable: params.enableWebGL,
|
||||
});
|
||||
|
||||
if (!this.intentStates[renderingIntent]) {
|
||||
|
|
|
@ -345,8 +345,6 @@ function getDefaultSetting(id) {
|
|||
return globalSettings ? globalSettings.disableFontFace : false;
|
||||
case 'disableCreateObjectURL':
|
||||
return globalSettings ? globalSettings.disableCreateObjectURL : false;
|
||||
case 'disableWebGL':
|
||||
return globalSettings ? globalSettings.disableWebGL : true;
|
||||
case 'cMapUrl':
|
||||
return globalSettings ? globalSettings.cMapUrl : null;
|
||||
case 'cMapPacked':
|
||||
|
|
|
@ -180,13 +180,6 @@ PDFJS.postMessageTransfers = (PDFJS.postMessageTransfers === undefined ?
|
|||
PDFJS.disableCreateObjectURL = (PDFJS.disableCreateObjectURL === undefined ?
|
||||
false : PDFJS.disableCreateObjectURL);
|
||||
|
||||
/**
|
||||
* Disables WebGL usage.
|
||||
* @var {boolean}
|
||||
*/
|
||||
PDFJS.disableWebGL = (PDFJS.disableWebGL === undefined ?
|
||||
true : PDFJS.disableWebGL);
|
||||
|
||||
/**
|
||||
* Specifies the |target| attribute for external links.
|
||||
* The constants from {LinkTarget} should be used:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue