28 private bool _isInitialized;
41 this.PaintSurface += OnPaintSurface;
43 _isInitialized =
true;
48 #region Renderer Integration
65 private void OnPaintSurface(
object sender, SKPaintSurfaceEventArgs e)
70 var canvas = e.Surface.Canvas;
71 var width = e.Info.Width;
72 var height = e.Info.Height;
75 canvas.Clear(SKColors.Black);
80 if (_renderer !=
null)
90 Console.WriteLine($
"Paint surface error: {ex.Message}");
101 if (this.IsRealized && this.Window !=
null)
103 this.Window.InvalidateRect(this.Allocation,
false);
104 this.Window.ProcessUpdates(
true);
112 protected override void Dispose(
bool disposing)
116 this.PaintSurface -= OnPaintSurface;
119 base.Dispose(disposing);