Skip to content

web player migration from thorvg #13

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

Merged
merged 24 commits into from
May 27, 2024
Merged

web player migration from thorvg #13

merged 24 commits into from
May 27, 2024

Conversation

hermet
Copy link
Member

@hermet hermet commented May 24, 2024

tinyjin and others added 23 commits May 24, 2024 17:17
- introduce a `lit`(https://lit.dev)
- lit is most popular web component builder
- with lit, we can build high-performance WP with less code
- define separated model for better readability of interface
- implemented thorvg basic features

added features:
- Add version info
- Support setBgColor
- Support save2gif
- Support bounce mode
- Support intermission
- Support skipping needless animation by dom visible
- `index.html` : basic example
- `benchmark.html` : to check FPS, memory usage, latency(ms)
- added new exportable type `tvg`
- support jpg/png/svg/tvg load
- Support `resize` method
- Add `resolution` prop
when `lottie-player` has no `src` at first rendering, programmatical load wasn't working
`stop` worked like `pause`, when stopping animation, frame should be at 0
improved code consistency:
- removed double-quotes on string literal.
- removed double-equals (==)
- updated comments
Call the explicit memory deletion—binded in function `delete()`, which is highly recommended by the Memory management in Emscripten guideline.

The function will guarantee that the WASM module is cleaned up from the memory.

see: https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#memory-management

Additionally, WASM module's initialization part has been refactored to correspond to the change.
This change would help on testing dynamic creation/deletion of component.
Compared the FPS with ThorVG viewer at 1664x1664 resolution.
This minor tweak improves the performance by 2 to 5 FPS.
Previously, the Intersection Observer doesn't filter hidden animations when page just loaded.

Ensure that the only visible animations to be played. Hidden resources will be frozen in the initial load.
@hermet hermet added the infrastructure Dev infrastructure label May 24, 2024
@hermet hermet requested a review from tinyjin May 24, 2024 08:27
@hermet hermet self-assigned this May 24, 2024
Copy link

vercel bot commented May 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thorvg-perf-test ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2024 8:50am

@hermet hermet changed the title Hermet/migration web player migration from thorvg. May 24, 2024
@hermet hermet changed the title web player migration from thorvg. web player migration from thorvg May 24, 2024
@hermet hermet marked this pull request as draft May 24, 2024 08:28
@hermet hermet marked this pull request as ready for review May 24, 2024 08:40
- added thorvg submodule with v0.13.x branch,
- rearranged the relative path of it for wasm js.
@tinyjin
Copy link
Member

tinyjin commented May 27, 2024

@hermet

In thorvg.web, we may plan to have multiple projects in single repo here. It'd be better to separate each projects on different dir.

root
- thorvg(submodule)/
- perf-test/
- lottie-player/
- thorvg-js/

Currently, perf-test is on separated dir and lottie-player is on just root. Now it doesn't seem to be issue because perf-test will be moved soon. I believe we can have good directory structures later likely mono repo! :)

@hermet
Copy link
Member Author

hermet commented May 27, 2024

@hermet

In thorvg.web, we may plan to have multiple projects in single repo here. It'd be better to separate each projects on different dir.

root
- thorvg(submodule)/
- perf-test/
- lottie-player/
- thorvg-js/

Currently, perf-test is on separated dir and lottie-player is on just root. Now it doesn't seem to be issue because perf-test will be moved soon. I believe we can have good directory structures later likely mono repo! :)

Good idea. please do it.

@hermet hermet merged commit 112f026 into main May 27, 2024
2 checks passed
@hermet hermet deleted the hermet/migration branch June 14, 2024 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Dev infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants