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

Use the new Skottie animation builder #277

Closed mattleibow closed 2 months ago

mattleibow commented 2 months ago

Description of Change

The new builder supports loading embedded images as well as caching any images or files if they are re-used.

Fixes https://github.com/mono/SkiaSharp/issues/2173

Jasbirbhinder commented 3 weeks ago

@mattleibow I am reposting detail in this post as the other post closed and refered to this. Im adding screenshots and JSON file in this comment, that i am using in my Maui project. embedded image is not loading!!

this is Maui code. xmlns:skia="clr-namespace:SkiaSharp.Extended.UI.Controls;assembly=SkiaSharp.Extended.UI"

<skia:SKLottieView BackgroundColor="Red" HeightRequest="100" RepeatCount="-1" Source="https://lottie.host/e6ca851f-5408-44f3-8874-637caebbf0d5/SlgPlLNWlZ.json" WidthRequest="100" />

1

this it is loading without embedded image 2

this it suppose to load 3

attached json file blizzard.json

Glomby commented 2 days ago

Embedded images work for me with the latest preview updated, so this has definitly improved the usabilty alot. However, I do have some very severe performance issues with my animations that use embedded images. On my android test device the screen renderning goes from 60 Hz (under Xamarin.Forms with lottie) down to 7-12 Hz (with the same lottie animations but under maui).

I testet a few things and removing some other elements gets the fps up to 20 but not 60. I created a small sample project with this issue to test. Maybe the way images are handled causes these performance problems. Here ist the issue, with a link to a sample project. Just press the button to get to the problematic animations: https://github.com/mono/SkiaSharp.Extended/issues/283