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

ImageLoader uses bg thread for processing #4069

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jazzay
Copy link

@jazzay jazzay commented Feb 18, 2024

Modifies ImageLoader's load function to use background threads for the image decoding work. This avoids blocking the main thread that is especially noticeable when loading many images at once.

This was modelled after the other loader implementations that also use threads.

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

In some cases you want the blocking behavior though (to avoid a frame of showing no image) so it would be better if this was an optional behavior.

Also, this won't work on Wasm

@jazzay
Copy link
Author

jazzay commented Feb 19, 2024

fixed the cranky errors. Will look at making this optional and disabled for Wasm.

@emilk emilk marked this pull request as draft March 25, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants