mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-21 20:52:12 -03:00
Enable willReadFrequently for canvas 2D contexts
Adds the willReadFrequently: true option to all getContext('2d') calls on temporary canvases in Canvas, CanvasLayers, and SAMDetectorIntegration modules. This improves performance for frequent pixel data reads, addressing potential browser optimization issues.
This commit is contained in:
@@ -98,7 +98,8 @@ export class Canvas {
|
||||
|
||||
this.offscreenCanvas = document.createElement('canvas');
|
||||
this.offscreenCtx = this.offscreenCanvas.getContext('2d', {
|
||||
alpha: false
|
||||
alpha: false,
|
||||
willReadFrequently: true
|
||||
});
|
||||
|
||||
this.dataInitialized = false;
|
||||
|
||||
Reference in New Issue
Block a user