Beispiel #1
0
 public override void DrawRect(CGRect dirtyRect)
 {
     lock (SyncRoot)
         _nonUiRedrawQueued = false;
     Dispatcher.UIThread.RunJobs(DispatcherPriority.Render);
     lock (SyncRoot)
     {
         if (_backBuffer != null)
         {
             using (var context = NSGraphicsContext.CurrentContext.GraphicsPort)
             {
                 context.SetFillColor(255, 255, 255, 255);
                 context.FillRect(new CGRect(default(CGPoint), LogicalSize));
                 context.TranslateCTM(0, LogicalSize.Height - _backBuffer.LogicalSize.Height);
                 context.DrawImage(new CGRect(default(CGPoint), _backBuffer.LogicalSize), _backBuffer.Image);
                 context.Flush();
                 NSGraphicsContext.CurrentContext.FlushGraphics();
             }
         }
     }
     _tl.Paint?.Invoke(dirtyRect.ToAvaloniaRect());
 }
Beispiel #2
0
 public override void DrawRect(CGRect dirtyRect)
 {
     _tl.Paint?.Invoke(dirtyRect.ToAvaloniaRect());
 }