Skip to content

lottie-player: replace immediate rendering with render loop#255

Open
tinyjin wants to merge 1 commit intomainfrom
jinny/lottie-render-loop
Open

lottie-player: replace immediate rendering with render loop#255
tinyjin wants to merge 1 commit intomainfrom
jinny/lottie-render-loop

Conversation

@tinyjin
Copy link
Copy Markdown
Member

@tinyjin tinyjin commented Mar 17, 2026

Remove direct _render() calls and unified render loop handle.

CleanShot 2026-03-17 at 21 08 05

related: #251

@tinyjin tinyjin self-assigned this Mar 17, 2026
@tinyjin tinyjin requested a review from hermet as a code owner March 17, 2026 12:12
Copilot AI review requested due to automatic review settings March 17, 2026 12:12
@tinyjin tinyjin added enhancement Improve features lottie-player Lottie Player labels Mar 17, 2026
Remove direct _render() calls and unified render loop handle.

related: #251
@tinyjin tinyjin force-pushed the jinny/lottie-render-loop branch from f0a9f71 to 8334f62 Compare March 17, 2026 12:13
Copy link
Copy Markdown

Copilot AI left a 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 refactors lottie-player rendering to avoid immediate _render() calls and instead drive drawing via a unified requestAnimationFrame render loop, aiming to address first-load display issues on GPU engines (Issue #251).

Changes:

  • Introduces RAF-managed render loop state (_rafId) and a dirty flag (_dirty) to coordinate rendering.
  • Replaces direct _render() calls with _requestRender() in load/seek/resize/quality paths.
  • Cancels any scheduled RAF on destroy() and sets currentState to Loading at the start of load().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

🚀 Perf Test preview deployment ready!

📊 Perf Test: https://thorvg-perf-test-h35nrtizi-thorvg-web.vercel.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improve features lottie-player Lottie Player

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants