mono / SkiaSharp.Extended

SkiaSharp is a cross-platform, comprehensive 2D graphics API for all .NET platforms. And, here is where you will find all sorts of extras that you can use with it.
https://mono.github.io/SkiaSharp.Extended
MIT License
218 stars 69 forks source link

Very poor performance with certain animations[BUG] #283

Open Glomby opened 1 week ago

Glomby commented 1 week ago

Description

I am porting a Xamarin.Forms App to Maui and therefor switched from the xamarin lottie plugin to SKottie. All animations are the same as in the Xamarin App but on some animations the screen rendering goes from 60 down to 12 fps or even lower. I uploaded one of those animations to test it yourself.

The only thing I found so far is that it might have something to do with embedded images in those animations. Which has only been added recently so maybe there are still issues because of it. Those very same animations however run perfectly fine in my old App.

I might have also found animations without embedded images that are causing issues like this but im still testing those. It is slowing down my Apps UI so much though that the user experience is heavily reduced due to these slow animations. Edit: Yes I did find one of my animations with multiples gradients but no embedded images to cause very poor performance too.

Expected Behavior

Animations should run smoothly without affecting the UI of the App.

Actual Behavior Screen rendering goes way below 60 fps (on a 60Hz phone) and the whole UI feels sluggish. I measured as low is 6 fps.

Basic Information

Reproduction Link

Simplified Testproject: Press the button to get to the most problematic animations. All of this runs absolutely flawlessly in Xamarin, even on older Android Devices:

https://github.com/Glomby/Maui-Skottie-Performance-Test

https://app.lottiefiles.com/share/a34d4778-b012-4ca9-911c-5b45ea19788f