[api-minor] Remove the WebGL implementation

Reasons for the removal include:
 - This functionality was always somewhat experimental and has never been enabled by default, partly because of worries about rendering bugs caused by e.g. bad/outdated graphics drivers.

 - After the initial implementation, in PR 4286 (back in 2014), no additional functionality has been added to the WebGL implementation.

 - The vast majority of all documents do not benefit from WebGL rendering, since only a couple of *specific* features are supported (e.g. some Soft Masks and Patterns).

 - There is, and has always been, *zero* test-coverage for the WebGL implementation.

 - Overall performance, in the PDF.js library, has improved since the experimental WebGL implementation was added.

Rather than shipping unused *and* untested code, it seems reasonable to simply remove the WebGL implementation for now; thanks to version control it's always possible to bring back the code should the need ever arise.
This commit is contained in:
Jonas Jenwald 2021-05-09 15:54:26 +02:00
parent 99eac86478
commit 2ba4b65ca8
9 changed files with 28 additions and 608 deletions

View file

@ -354,9 +354,6 @@ const PDFViewerApplication = {
if ("disablehistory" in hashParams) {
AppOptions.set("disableHistory", hashParams.disablehistory === "true");
}
if ("webgl" in hashParams) {
AppOptions.set("enableWebGL", hashParams.webgl === "true");
}
if ("verbosity" in hashParams) {
AppOptions.set("verbosity", hashParams.verbosity | 0);
}
@ -511,7 +508,6 @@ const PDFViewerApplication = {
findController,
scriptingManager: pdfScriptingManager,
renderer: AppOptions.get("renderer"),
enableWebGL: AppOptions.get("enableWebGL"),
l10n: this.l10n,
textLayerMode: AppOptions.get("textLayerMode"),
imageResourcesPath: AppOptions.get("imageResourcesPath"),
@ -1520,8 +1516,7 @@ const PDFViewerApplication = {
console.log(
`PDF ${pdfDocument.fingerprint} [${info.PDFFormatVersion} ` +
`${(info.Producer || "-").trim()} / ${(info.Creator || "-").trim()}] ` +
`(PDF.js: ${version || "-"}` +
`${this.pdfViewer.enableWebGL ? " [WebGL]" : ""})`
`(PDF.js: ${version || "-"})`
);
let pdfTitle = info?.Title;