source/SkiaSharp.Views.Uno/SkiaSharp.Views.Uno.WinUI/SKXamlCanvas.AppleiOS.cs [42:85]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - return; // create the skia context using var surface = drawable.CreateSurface(Bounds, ContentScaleFactor, out var info); if (info.Width == 0 || info.Height == 0) { CanvasSize = SKSize.Empty; return; } var userVisibleSize = IgnorePixelScaling ? new SKSizeI((int)Bounds.Width, (int)Bounds.Height) : info.Size; CanvasSize = userVisibleSize; if (IgnorePixelScaling) { var skiaCanvas = surface.Canvas; skiaCanvas.Scale((float)ContentScaleFactor); skiaCanvas.Save(); } using var ctx = UIGraphics.GetCurrentContext(); // draw on the image using SKiaSharp OnPaintSurface(new SKPaintSurfaceEventArgs(surface, info.WithSize(userVisibleSize), info)); // draw the surface to the context drawable.DrawSurface(ctx, Bounds, info, surface); } public override void WillMoveToWindow(UIWindow window) { if (drawable != null) { // release the memory if we are leaving the window if (window == null) drawable?.Dispose(); else SetNeedsDisplay(); } base.WillMoveToWindow(window); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - source/SkiaSharp.Views/SkiaSharp.Views/Platform/iOS/SKCanvasView.cs [84:128]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - return; // create the skia context using var surface = drawable.CreateSurface(Bounds, ContentScaleFactor, out var info); if (info.Width == 0 || info.Height == 0) { CanvasSize = SKSize.Empty; return; } var userVisibleSize = IgnorePixelScaling ? new SKSizeI((int)Bounds.Width, (int)Bounds.Height) : info.Size; CanvasSize = userVisibleSize; if (IgnorePixelScaling) { var skiaCanvas = surface.Canvas; skiaCanvas.Scale((float)ContentScaleFactor); skiaCanvas.Save(); } using var ctx = UIGraphics.GetCurrentContext(); // draw on the image using SKiaSharp OnPaintSurface(new SKPaintSurfaceEventArgs(surface, info.WithSize(userVisibleSize), info)); // draw the surface to the context drawable.DrawSurface(ctx, Bounds, info, surface); } public override void WillMoveToWindow(UIWindow window) { if (drawable != null) { // release the memory if we are leaving the window if (window == null) drawable?.Dispose(); else SetNeedsDisplay(); } base.WillMoveToWindow(window); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -