diff --git a/src/Avalonia.Base/Platform/IBitmapWithPixelReadAccessImpl.cs b/src/Avalonia.Base/Platform/IReadableBitmapImpl.cs similarity index 100% rename from src/Avalonia.Base/Platform/IBitmapWithPixelReadAccessImpl.cs rename to src/Avalonia.Base/Platform/IReadableBitmapImpl.cs diff --git a/src/Avalonia.Base/Platform/PixelFormat.cs b/src/Avalonia.Base/Platform/PixelFormat.cs index 9c57abe343..99fe17055d 100644 --- a/src/Avalonia.Base/Platform/PixelFormat.cs +++ b/src/Avalonia.Base/Platform/PixelFormat.cs @@ -16,7 +16,7 @@ namespace Avalonia.Platform Rgba64 } - public struct PixelFormat : IEquatable + public record struct PixelFormat { internal PixelFormatEnum FormatEnum; @@ -54,32 +54,7 @@ namespace Avalonia.Platform public static PixelFormat Rgb565 => PixelFormats.Rgb565; public static PixelFormat Rgba8888 => PixelFormats.Rgba8888; public static PixelFormat Bgra8888 => PixelFormats.Bgra8888; - - public bool Equals(PixelFormat other) - { - return FormatEnum == other.FormatEnum; - } - - public override bool Equals(object? obj) - { - return obj is PixelFormat other && Equals(other); - } - - public override int GetHashCode() - { - return (int)FormatEnum; - } - - public static bool operator ==(PixelFormat left, PixelFormat right) - { - return left.Equals(right); - } - - public static bool operator !=(PixelFormat left, PixelFormat right) - { - return !left.Equals(right); - } - + public override string ToString() => FormatEnum.ToString(); }