mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Check OffscreenCanvas
support once on the worker-thread
Currently we repeat the `FeatureTest.isOffscreenCanvasSupported` checks all over the worker-thread code, and with upcoming changes this will become even "worse". Hence this patch, which changes the *worker-thread* default value for the `isOffscreenCanvasSupported`-parameter to `false` and moves the feature-testing into the `BasePdfManager`-constructor. *Please note:* This patch is written using the GitHub UI, since I'm currently without a dev machine, so hopefully it works correctly.
This commit is contained in:
parent
2da2ac492e
commit
45c332110e
4 changed files with 12 additions and 16 deletions
|
@ -15,6 +15,7 @@
|
|||
|
||||
import {
|
||||
createValidAbsoluteUrl,
|
||||
FeatureTest,
|
||||
shadow,
|
||||
unreachable,
|
||||
warn,
|
||||
|
@ -44,6 +45,12 @@ class BasePdfManager {
|
|||
this._docId = args.docId;
|
||||
this._password = args.password;
|
||||
this.enableXfa = args.enableXfa;
|
||||
|
||||
// Check `OffscreenCanvas` support once, rather than repeatedly throughout
|
||||
// the worker-thread code.
|
||||
args.evaluatorOptions.isOffscreenCanvasSupported =
|
||||
args.evaluatorOptions.isOffscreenCanvasSupported &&
|
||||
FeatureTest.isOffscreenCanvasSupported;
|
||||
this.evaluatorOptions = args.evaluatorOptions;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue