mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Add an option to enable/disable hardware acceleration (bug 1902012)
This commit is contained in:
parent
341ff40e74
commit
ff6180a4c9
13 changed files with 62 additions and 12 deletions
|
@ -98,7 +98,7 @@ class ImageManager {
|
|||
// behavior in Safari.
|
||||
const svg = `data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>`;
|
||||
const canvas = new OffscreenCanvas(1, 3);
|
||||
const ctx = canvas.getContext("2d");
|
||||
const ctx = canvas.getContext("2d", { willReadFrequently: true });
|
||||
const image = new Image();
|
||||
image.src = svg;
|
||||
const promise = image.decode().then(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue