-
Notifications
You must be signed in to change notification settings - Fork 514
SkiaApi.Context() fails if not ran on the main thread #3137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please be aware that Skia Ganesh is very much not multi threaded. Can you provide more information on what you are doing/trying to do? This sounds interesting. |
We're fine that it's not multi-threaded. We're using it to render a Skia overlay directly onto a hardware surface that we get from The rendering is single-threaded, and is handled synchronously on the JS thread. That's why it's triggering the UI diagnostics, that expect the |
That sounds really interesting. |
We're using Skia to render a 2D overlay with controls and high-quality text on top of a 3D canvas. For now, we actually create a second WGPU canvas that overlays the 3D one, and only use the I have plans to do rendering into a texture buffer, and it seems doable. On Android via |
I'm using SkiaApi.Context() to render onto a surface obtained from WebGPU:
This works, but produces a stack trace on the debug console with a message "Modifying properties of a view's layer off the main thread is not allowed". This not only pollutes the logs, but it also is slow (~300ms).
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: