protected override void Dispose(bool disposing) { base.Dispose(disposing); if (_imageFilter != null) { _imageFilter.Dispose(); } _bgrBuffers.Dispose(); }
/// <inheritdoc cref="IPaintTask{TDrawingContext}.ResetOpacity(TDrawingContext, IGeometry{TDrawingContext})" /> public override void ResetOpacity(SkiaSharpDrawingContext context, IGeometry <SkiaSharpDrawingContext> geometry) { if (context.PaintTask is null || context.Paint is null) { return; } if (ImageFilter is not null) { ImageFilter.Dispose(); } var baseColor = context.PaintTask.Color; context.Paint.Color = baseColor; }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public override void Dispose() { if (PathEffect is not null) { PathEffect.Dispose(); } if (ImageFilter is not null) { ImageFilter.Dispose(); } if (_drawingContext is not null && GetClipRectangle(_drawingContext.MotionCanvas) != RectangleF.Empty) { _drawingContext.Canvas.Restore(); _drawingContext = null; } base.Dispose(); }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public override void Dispose() { if (FontFamily != null && skiaPaint != null) { skiaPaint.Typeface.Dispose(); } if (PathEffect is not null) { PathEffect.Dispose(); } if (ImageFilter is not null) { ImageFilter.Dispose(); } if (_drawingContext is not null && GetClipRectangle(_drawingContext.MotionCanvas) != LvcRectangle.Empty) { _drawingContext.Canvas.Restore(); _drawingContext = null; } base.Dispose(); }