Browse Source

Enable Metal rendering by default for iOS and macOS (#14762)

pull/14893/head
Max Katz 3 years ago
committed by GitHub
parent
commit
c9b86bf921
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs
  2. 8
      src/iOS/Avalonia.iOS/Platform.cs

12
src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs

@ -29,6 +29,9 @@ namespace Avalonia
} }
} }
/// <summary>
/// Represents the rendering mode for platform graphics.
/// </summary>
public enum AvaloniaNativeRenderingMode public enum AvaloniaNativeRenderingMode
{ {
/// <summary> /// <summary>
@ -42,7 +45,6 @@ namespace Avalonia
/// <summary> /// <summary>
/// Avalonia would try to use Metal with GPU rendering. /// Avalonia would try to use Metal with GPU rendering.
/// </summary> /// </summary>
[Obsolete("Experimental, unstable, not for production usage")]
Metal = 3 Metal = 3
} }
@ -63,10 +65,11 @@ namespace Avalonia
/// <exception cref="System.InvalidOperationException">Thrown if no values were matched.</exception> /// <exception cref="System.InvalidOperationException">Thrown if no values were matched.</exception>
public IReadOnlyList<AvaloniaNativeRenderingMode> RenderingMode { get; set; } = new[] public IReadOnlyList<AvaloniaNativeRenderingMode> RenderingMode { get; set; } = new[]
{ {
AvaloniaNativeRenderingMode.Metal,
AvaloniaNativeRenderingMode.OpenGl, AvaloniaNativeRenderingMode.OpenGl,
AvaloniaNativeRenderingMode.Software AvaloniaNativeRenderingMode.Software
}; };
/// <summary> /// <summary>
/// Embeds popups to the window when set to true. The default value is false. /// Embeds popups to the window when set to true. The default value is false.
/// </summary> /// </summary>
@ -100,7 +103,10 @@ namespace Avalonia
/// Gets or sets a value indicating whether the native macOS menu bar will be enabled for the application. /// Gets or sets a value indicating whether the native macOS menu bar will be enabled for the application.
/// </summary> /// </summary>
public bool DisableNativeMenus { get; set; } public bool DisableNativeMenus { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the native macOS should set [NSProcessInfo setProcessName] in runtime.
/// </summary>
public bool DisableSetProcessName { get; set; } public bool DisableSetProcessName { get; set; }
/// <summary> /// <summary>

8
src/iOS/Avalonia.iOS/Platform.cs

@ -12,6 +12,9 @@ using Avalonia.Threading;
namespace Avalonia namespace Avalonia
{ {
/// <summary>
/// Represents the rendering mode for platform graphics.
/// </summary>
public enum iOSRenderingMode public enum iOSRenderingMode
{ {
/// <summary> /// <summary>
@ -25,6 +28,9 @@ namespace Avalonia
Metal Metal
} }
/// <summary>
/// iOS backend options.
/// </summary>
public class iOSPlatformOptions public class iOSPlatformOptions
{ {
/// <summary> /// <summary>
@ -35,7 +41,7 @@ namespace Avalonia
/// <exception cref="System.InvalidOperationException">Thrown if no values were matched.</exception> /// <exception cref="System.InvalidOperationException">Thrown if no values were matched.</exception>
public IReadOnlyList<iOSRenderingMode> RenderingMode { get; set; } = new[] public IReadOnlyList<iOSRenderingMode> RenderingMode { get; set; } = new[]
{ {
iOSRenderingMode.OpenGl, iOSRenderingMode.Metal iOSRenderingMode.Metal, iOSRenderingMode.OpenGl
}; };
} }

Loading…
Cancel
Save