Skip to content

Commit

Permalink
fix(skia): Restore original canvas state for Software renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed May 18, 2022
1 parent 1998409 commit e861f6c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Uno.UI.Runtime.Skia.Gtk/SoftwareRenderSurface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,21 @@ protected override bool OnDrawn(Context cr)
}

var canvas = _surface.Canvas;
canvas.Clear(SKColors.White);
canvas.Scale(_dpi);

WUX.Window.Current.Compositor.Render(_surface);
using (new SKAutoCanvasRestore(canvas, true))
{
canvas.Clear(SKColors.White);
canvas.Scale(_dpi);

WUX.Window.Current.Compositor.Render(_surface);
}

_gtkSurface!.MarkDirty();
cr.Save();
cr.Scale(1 / _dpi, 1 / _dpi);
cr.SetSourceSurface(_gtkSurface, 0, 0);
cr.Paint();
cr.Restore();

if (this.Log().IsEnabled(LogLevel.Trace))
{
Expand Down

0 comments on commit e861f6c

Please sign in to comment.