Skip to content
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

Fix Android threading issue #2749

Merged
merged 9 commits into from
Nov 19, 2024
Merged

Conversation

wcandillon
Copy link
Contributor

@wcandillon wcandillon commented Nov 19, 2024

Currently every offscreen surfaces share the same root context even though they can be created from different thread.
This can easily cause crashes, especially in viewRef.makeImageSnapshot which is using an offscreen surface.

We also suspect that because onscreen surfaces are using the parent context where all the offscreen surfaces are created with, it may also cause some error.

We also took advantage of the issue to make a refactoring of the OpenGL logic.

  • Add back native buffer implementation

@wcandillon wcandillon marked this pull request as draft November 19, 2024 19:09
@wcandillon wcandillon marked this pull request as ready for review November 19, 2024 21:45
@wcandillon wcandillon merged commit 6fbaeab into Shopify:main Nov 19, 2024
8 checks passed
Copy link
Contributor

🎉 This PR is included in version 1.5.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Saadnajmi pushed a commit to Saadnajmi/react-native-skia that referenced this pull request Dec 21, 2024
Every offscreen surfaces where sharing the OpenGL context even though they may be created from different thread.
This can easily cause crashes, especially in viewRef.makeImageSnapshot which is using an offscreen surface.
We sanitized the OpenGLContext to not have anything shared across threads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant