1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Artemis/src/Artemis.Core/Extensions/SKPaintExtensions.cs
2023-08-22 16:01:32 +02:00

22 lines
618 B
C#

using SkiaSharp;
namespace Artemis.Core;
/// <summary>
/// A static class providing <see cref="SKPaint" /> extensions
/// </summary>
public static class SKPaintExtensions
{
/// <summary>
/// Disposes the paint and its disposable properties such as shaders and filters.
/// </summary>
/// <param name="paint">The pain to dispose.</param>
public static void DisposeSelfAndProperties(this SKPaint paint)
{
paint.ImageFilter?.Dispose();
paint.ColorFilter?.Dispose();
paint.MaskFilter?.Dispose();
paint.Shader?.Dispose();
paint.Dispose();
}
}