mono / SkiaSharp

SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
MIT License
4.52k stars 540 forks source link

[BUG] On iOS SKSurface.Snapshot returns null when called from SKGLView #1600

Open feelIpk opened 3 years ago

feelIpk commented 3 years ago

Snapshot() method of SKSurface always returns null on iOS devices (both physical and virtual) when it's called inside SKGLView, but it seems to work when it is used from SKCanvasView. Actually it looks exactly like an old issue which was fixed in 1.6, but it works fine on Android devices this time. (https://github.com/mono/SkiaSharp/issues/436).

protected override void OnPaintSurface(SKPaintGLSurfaceEventArgs e)
{
   var snapshot = e.Surface.Snapshot();
   if(snapshot == null)
   {
   //code on iOS enters here
   }
}

Expected Behavior

Returns valid SKImage

Actual Behavior

Returns null

Basic Information

mahesh139 commented 3 years ago

I am facing similar problem with SKCanvasView on iOS, works fine on android. SkiaSharp version : 2.80.2 iOS : 14.4

xamiell commented 2 years ago

Same problem on iOS.