You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AnimatedVisualPlayer keeps rendering loop active when hidden or stopped (Skia) #23189
On Skia, AnimatedVisualPlayer continues to drive the CompositionTarget.Rendering loop at full FPS even when the player is hidden (Visibility=Collapsed) or its parent is collapsed. Calling player.Stop() does not reliably bring the system framerate counter back down, and CPU load remains high.
Expected behavior
When the player becomes effectively invisible (collapsed, or removed from the tree), the underlying source should pause and the CompositionTarget.Rendering subscription should be released so the system rendering loop can idle. When the player becomes visible again, playback should resume automatically (matching native WinUI's AnimationPlay::OnHiding / OnUnhiding behavior). Stop() should reliably remove the subscription.
Why
LottieVisualSource on Skia drives the animation by subscribing to CompositionTarget.Rendering. Any subscriber to that event keeps Uno's render loop running at the display refresh rate. The native WinUI player explicitly pauses on hide for exactly this reason — its source comments call out "this is necessary to ensure that the animation doesn't keep running and causing DWM to wake up when the animation cannot be seen."
In addition, Uno wired the read-only DPs IsPlaying, IsAnimatedVisualLoaded, and Duration to the UpdateSourceOnChanged callback. WinUI registers callbacks only on input properties (Source, Stretch, AutoPlay, PlaybackRate, FallbackContent, AnimationOptimization). The unwanted callback on IsPlaying causes Stop() to reentrantly re-Update() the source while it is tearing down.
Repro
Place an AnimatedVisualPlayer with AutoPlay=True and a LottieVisualSource on a Skia page.
Observe the framerate counter — it sits at the display refresh rate.
Either set player.Visibility = Visibility.Collapsed or call player.Stop().
Framerate counter does not stabilize back to idle; CPU load remains.
Activity
fix: Pause AnimatedVisualPlayer when hidden to release Skia render lo…
test: Add AnimatedVisualPlayer visibility repro sample (#23189)
fix: Drive Skia Lottie clock from paint, drop CompositionTarget.Rende…