-
Notifications
You must be signed in to change notification settings - Fork 17
feat: implement thorvg asset resolver for improved image handling #401
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
base: main
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements ThorVG's native asset resolver system to replace the existing base64 encoding pipeline for handling dotLottie image assets. This optimization eliminates unnecessary encoding/decoding overhead and reduces memory usage while maintaining the same functionality.
- Replace base64 encoding/decoding with direct asset resolution through ThorVG's native API
- Add asset resolver callback mechanism to handle image assets on-demand
- Remove redundant base64 encoding implementation and related constants
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| dotlottie-rs/src/lottie_renderer/thorvg.rs | Implements ThorVG asset resolver wrapper and integration with native API |
| dotlottie-rs/src/lottie_renderer/renderer.rs | Adds asset resolver trait method to Animation interface |
| dotlottie-rs/src/lottie_renderer/mod.rs | Defines AssetResolverFn type and adds asset resolver support to LottieRenderer trait |
| dotlottie-rs/src/fms/mod.rs | Replaces base64 encoding with direct asset resolution method |
| dotlottie-rs/src/dotlottie_player.rs | Integrates asset resolver callback with DotLottieManager for runtime asset loading |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
8e150d0 to
b4b139c
Compare
2da3760 to
5dbf4df
Compare
|
This must be applied with ThorVG v1.0-pre30. |
|
Fyi. @theashraf For now ThorVG doesn’t support Font Asset Resolver, this patch would cover the image asset resolution pipeline as this PR aims. We’ll soon support Font with asset resolver and will separately make patch for the Font. |
Replace existing base64 encoding pipeline with ThorVG's native asset resolver system. This eliminates unnecessary encoding/decoding overhead and reduces memory usage when processing dotLottie image assets.
dotLottie just introduced Font Assets Support
b64 decode isn't necessary by recently introduced asset resolver. removed that logic as well as unused variables for binary size benefits.
433c38d to
95503df
Compare
📊 Benchmark Resultsdotlottie-rs
How to interpret these results
Criterion uses statistical analysis to account for noise and provide reliable comparisons. |


Replace existing base64 encoding pipeline with ThorVG's native asset resolver system.
This eliminates unnecessary encoding/decoding overhead and reduces memory usage when processing dotLottie image assets.
Asset Test Results
Image Resolution
Font Resolution
// TODO: soon I will attach