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
{
/// <summary>
@ -42,7 +45,6 @@ namespace Avalonia
/// <summary>
/// Avalonia would try to use Metal with GPU rendering.
/// </summary>
[Obsolete("Experimental, unstable, not for production usage")]
Metal = 3
}
@ -63,10 +65,11 @@ namespace Avalonia
/// <exception cref="System.InvalidOperationException">Thrown if no values were matched.</exception>
public IReadOnlyList<AvaloniaNativeRenderingMode> RenderingMode { get; set; } = new[]
{
AvaloniaNativeRenderingMode.Metal,
AvaloniaNativeRenderingMode.OpenGl,
AvaloniaNativeRenderingMode.Software
};
/// <summary>
/// Embeds popups to the window when set to true. The default value is false.
/// </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.
/// </summary>
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; }
/// <summary>

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

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

Loading…
Cancel
Save