From c9b86bf921465f15d3e42c4980bad81604900df1 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Fri, 8 Mar 2024 17:16:45 -0800 Subject: [PATCH] Enable Metal rendering by default for iOS and macOS (#14762) --- .../AvaloniaNativePlatformExtensions.cs | 12 +++++++++--- src/iOS/Avalonia.iOS/Platform.cs | 8 +++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs b/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs index d5fffbbff0..67da919a01 100644 --- a/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs +++ b/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs @@ -29,6 +29,9 @@ namespace Avalonia } } + /// + /// Represents the rendering mode for platform graphics. + /// public enum AvaloniaNativeRenderingMode { /// @@ -42,7 +45,6 @@ namespace Avalonia /// /// Avalonia would try to use Metal with GPU rendering. /// - [Obsolete("Experimental, unstable, not for production usage")] Metal = 3 } @@ -63,10 +65,11 @@ namespace Avalonia /// Thrown if no values were matched. public IReadOnlyList RenderingMode { get; set; } = new[] { + AvaloniaNativeRenderingMode.Metal, AvaloniaNativeRenderingMode.OpenGl, AvaloniaNativeRenderingMode.Software }; - + /// /// Embeds popups to the window when set to true. The default value is false. /// @@ -100,7 +103,10 @@ namespace Avalonia /// Gets or sets a value indicating whether the native macOS menu bar will be enabled for the application. /// public bool DisableNativeMenus { get; set; } - + + /// + /// Gets or sets a value indicating whether the native macOS should set [NSProcessInfo setProcessName] in runtime. + /// public bool DisableSetProcessName { get; set; } /// diff --git a/src/iOS/Avalonia.iOS/Platform.cs b/src/iOS/Avalonia.iOS/Platform.cs index 57d31f773c..8006639406 100644 --- a/src/iOS/Avalonia.iOS/Platform.cs +++ b/src/iOS/Avalonia.iOS/Platform.cs @@ -12,6 +12,9 @@ using Avalonia.Threading; namespace Avalonia { + /// + /// Represents the rendering mode for platform graphics. + /// public enum iOSRenderingMode { /// @@ -25,6 +28,9 @@ namespace Avalonia Metal } + /// + /// iOS backend options. + /// public class iOSPlatformOptions { /// @@ -35,7 +41,7 @@ namespace Avalonia /// Thrown if no values were matched. public IReadOnlyList RenderingMode { get; set; } = new[] { - iOSRenderingMode.OpenGl, iOSRenderingMode.Metal + iOSRenderingMode.Metal, iOSRenderingMode.OpenGl }; }