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; }
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); }
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; } }
public void Dispose() { _surface?.Dispose(); _surface = null; }