fserb / canvas2D

Update Canvas 2D API
Other
149 stars 25 forks source link

CanvasFilters - Even <feImage>? #13

Open Kaiido opened 3 years ago

Kaiido commented 3 years ago

The <feImage> SVG filter primitive allows to load external resources and graphic elements accessible in the document.

This filter seems to create a few issues with how the canvas API works.

Fetching resources should be an async operation, this means that by the time we pass the resulting CanvasFilter to the canvas, the resource may still not be ready to be rendered. SVG doesn't have this problem, it can just rerender when the resource is loaded. Canvas can't do that.

Currently the best I can think of would be to make it take ImageBitmaps instead of URIs.