Generate Skia Picture on another runtime #3556
Replies: 2 comments
-
|
Yes, you can absolutely do that as long as the picture doesn't contain gpu
resources such as other textures (images uploaded to gpu or
pictures containing textures).
That's actually a really good way to approach complex drawings.
…On Thu, Nov 20, 2025 at 10:35 AM akug17 ***@***.***> wrote:
Hey, i wanted to know if generating a Skia Picture on another runtime by
using runOnRuntime and then sending that generated picture back to JS
thread by using runOnJS and then storing it in sharedValue is something
possible or even recommended. The reason i am asking because right now i am
doing this inside useDerivedValue, my logic runs continous loop on UI
thread to generate a picture, i wanted to offload this task to separate
runtime and just apply the picture via sharedValue in Picture component
from Skia
—
Reply to this email directly, view it on GitHub
<#3556>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKXVV3ZYTZ52U4QOPLW5T35WDPPAVCNFSM6AAAAACMVQNIGGVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZZGE3DAMJRHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
akug17
-
|
So i was able to do this, i noticed if i do canvas.concat(matrix) in createPicture fn vs i just use matrix prop in component, performance seems to degrade in case of canvas.concat when i try to draw huge paths/rectangles even when the calculation is done on a separate thread. I get createPicture is basically a set of commands that gets replayed later on the UI but i wonder why matrix prop performs better than canvas.concat |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, i wanted to know if generating a Skia Picture on another runtime by using runOnRuntime and then sending that generated picture back to JS thread by using runOnJS and then storing it in sharedValue is something possible or even recommended. The reason i am asking because right now i am doing this inside useDerivedValue, my logic runs continous loop on UI thread to generate a picture, i wanted to offload this task to separate runtime and just apply the picture via sharedValue in Picture component from Skia
Beta Was this translation helpful? Give feedback.
All reactions