Skip to content

Commit c1becd3

Browse files
kalwaltCopilot
andauthored
Update src/worker/worker.js
- The context hint should be willReadFrequently: true since getImageData is called on line 291 as a fallback. The 'false' value may hurt performance when ImageData is actually needed. Co-authored-by: Copilot <[email protected]>
1 parent 716b501 commit c1becd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/worker/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ onMessage(async (ev) => {
276276
if (!offscreenCanvas || canvasW !== w || canvasH !== h) {
277277
canvasW = w; canvasH = h;
278278
offscreenCanvas = new OffscreenCanvas(canvasW, canvasH);
279-
offscreenCtx = offscreenCanvas.getContext('2d', { willReadFrequently: false });
279+
offscreenCtx = offscreenCanvas.getContext('2d', { willReadFrequently: true });
280280
}
281281

282282
offscreenCtx.clearRect(0, 0, canvasW, canvasH);

0 commit comments

Comments
 (0)