SkiaSharp Views - OpenGL Animation Question

rac146rac146 USMember
edited October 2016 in Cross Platform with Xamarin

First off, shout out to @mattleibow for the awesome work on SkiaSharp!

I'm currently trying to display and animate a large image using SkiaSharp and the new OpenGL SkiaSharp Views. I have split the image into 2048x2048 tiles and render it onto my canvas using the DrawBitmap method (with sizing and offset logic).

My issue comes in when I try to animate the image using an integrated PanGestureRecognizer. The image moves nicely (and incredibly fast) around the screen with my touch, but if one of the tiles goes completely off screen, as soon as it comes back into focus the drawing will stutter for a very short, but noticeable period. After digging around, it seems OpenGL is deleting and recreating the texture when it goes off and on the screen.

Is there a way to tell the OpenGL renderer to do 1. Not automatically delete the textures when they go off screen, or 2. Improve the re-creation of the texture to prevent the stutter?

*NOTE - currently this occurring on Android. I do not have an IOS device to test with at the moment.


Sign In or Register to comment.