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.
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.