From 45b1f7b23ddc3abf9d52dfa712cf7c4517b97835 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Sun, 29 Jan 2023 12:40:41 +0600 Subject: [PATCH] Addressed PR comments --- ...adAccessImpl.cs => IReadableBitmapImpl.cs} | 0 src/Avalonia.Base/Platform/PixelFormat.cs | 29 ++----------------- 2 files changed, 2 insertions(+), 27 deletions(-) rename src/Avalonia.Base/Platform/{IBitmapWithPixelReadAccessImpl.cs => IReadableBitmapImpl.cs} (100%) 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(); }