From e034226bd5361055430563afd14e1c3093f79be0 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Mon, 27 Apr 2020 21:58:02 +0200 Subject: [PATCH] Tweak things... --- .../SkiaSharp.Views.UWP/SKSwapChainPanel.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/SkiaSharp.Views/SkiaSharp.Views.UWP/SKSwapChainPanel.cs b/source/SkiaSharp.Views/SkiaSharp.Views.UWP/SKSwapChainPanel.cs index c76e6a3c54..e16879c7aa 100644 --- a/source/SkiaSharp.Views/SkiaSharp.Views.UWP/SKSwapChainPanel.cs +++ b/source/SkiaSharp.Views/SkiaSharp.Views.UWP/SKSwapChainPanel.cs @@ -88,12 +88,15 @@ protected override void OnRenderFrame(Rect rect) lastPaintEventArgs = null; } - // start drawing + // create or recreate the event args if (!reusePaintEventArgsInstance || lastPaintEventArgs == null) lastPaintEventArgs = new SKPaintGLSurfaceEventArgs(surface, renderTarget, surfaceOrigin, colorType, glInfo); + // reset the draw matrix just in case + canvas.RestoreToCount(1); + + // start drawing OnPaintSurface(lastPaintEventArgs); - canvas.RestoreToCount(0); // update the control canvas.Flush();