Exemplo n.º 1
0
 public RenderOp(GtkWidget widget, ManagedCairoSurface surface, double factor, int width, int height)
 {
     _widget  = widget;
     _surface = surface ?? throw new ArgumentNullException();
     _factor  = factor;
     _width   = width;
     _height  = height;
 }
Exemplo n.º 2
0
        public ImageSurfaceFramebuffer(WindowBaseImpl impl, int width, int height, int factor)
        {
            _impl    = impl;
            _widget  = impl.GtkWidget;
            _factor  = factor;
            width   *= _factor;
            height  *= _factor;
            _surface = new ManagedCairoSurface(width, height);

            Size     = new PixelSize(width, height);
            Address  = _surface.Buffer;
            RowBytes = _surface.Stride;
            Native.CairoSurfaceFlush(_surface.Surface);
        }
Exemplo n.º 3
0
 public void Dispose()
 {
     lock (_lock)
     {
         if (Dispatcher.UIThread.CheckAccess())
         {
             if (_impl.CurrentCairoContext != IntPtr.Zero)
             {
                 Draw(_impl.CurrentCairoContext, _surface.Surface, _factor);
             }
             else
             {
                 DrawToWidget(_widget, _surface.Surface, Size.Width, Size.Height, _factor);
             }
             _surface.Dispose();
         }
         else
         {
             _impl.SetNextRenderOperation(new RenderOp(_widget, _surface, _factor, Size.Width, Size.Height));
         }
         _surface = null;
     }
 }
Exemplo n.º 4
0
 public void Dispose()
 {
     _surface?.Dispose();
     _surface = null;
 }