Fix ~1 second delay opening new document in Chrome by correctly setting willReadFrequently (#2962)

* Fix ~1 second delay opening new document in Chrome by correctly setting willReadFrequently

* Use willReadFrequently in a couple more places
This commit is contained in:
Keavon Chambers
2025-07-31 02:49:16 -07:00
committed by GitHub
parent abab145d65
commit 07802204f2
3 changed files with 4 additions and 4 deletions
@@ -93,7 +93,7 @@ export async function imageToCanvasContext(imageData: ImageBitmapSource): Promis
canvas.width = width;
canvas.height = height;
const context = canvas.getContext("2d");
const context = canvas.getContext("2d", { willReadFrequently: true });
if (!context) throw new Error("Could not create canvas context");
context.drawImage(image, 0, 0, image.width, image.height, 0, 0, width, height);