Closed YerkoPalma closed 6 years ago
they are βlikeβ a lightweight web worker in the sense that they are a separate scope and (potentially) thread. But they have almost no APIs exposed to them.
If you need to fetch an image for a paint worklet, you need to do that on the main thread and pass the image via custom properties.
@surma thanks for your response. One last thing
If you need to fetch an image for a paint worklet, you need to do that on the main thread and pass the image via custom properties.
Is possible to pass image data through custom properties? wow how do you do that?
Yes, you can in combination with Typed OM and Properties & Values API, although none of these are currently fully implemented in Chrome to support images as far as I know.
Oh I see, just found this example about image loading. Hope this get implemented soon :) thanks again
Hi π Thanks for this module! Your examples have been very helpful. Now, I'm confused about the scope of Worklets, the posts about worklets say they are like a lightweight web wroker, so, because of some of their similarities I though I could use the sames APIs availaible for workers, but that isn't true.
My specific use case, is that I was trying to draw an Image from a paintWorklet.
Here is the code of my worklet
This throws that fetch is not defined
So the question is, what APIs are availaible from a paintworklet? or any worklet?