Browse Source

Merge pull request #7968 from AvaloniaUI/feature/win32-gpu-blacklist

add win32 egl gpu blacklist.
7963-stable
Jumar Macato 4 years ago
committed by Dan Walmsley
parent
commit
4fab64719e
  1. 18
      src/Windows/Avalonia.Win32/Win32GlManager.cs
  2. 5
      src/Windows/Avalonia.Win32/Win32Platform.cs

18
src/Windows/Avalonia.Win32/Win32GlManager.cs

@ -24,9 +24,23 @@ namespace Avalonia.Win32
{ {
var egl = EglPlatformOpenGlInterface.TryCreate(() => new AngleWin32EglDisplay()); var egl = EglPlatformOpenGlInterface.TryCreate(() => new AngleWin32EglDisplay());
if (egl != null && opts.UseWindowsUIComposition) if (egl != null)
{ {
WinUICompositorConnection.TryCreateAndRegister(egl, opts.CompositionBackdropCornerRadius); if (opts.EglRendererBlacklist != null)
{
foreach (var item in opts.EglRendererBlacklist)
{
if (egl.PrimaryEglContext.GlInterface.Renderer.Contains(item))
{
return null;
}
}
}
if (opts.UseWindowsUIComposition)
{
WinUICompositorConnection.TryCreateAndRegister(egl, opts.CompositionBackdropCornerRadius);
}
} }
return egl; return egl;

5
src/Windows/Avalonia.Win32/Win32Platform.cs

@ -56,6 +56,11 @@ namespace Avalonia
/// GPU rendering will not be enabled if this is set to false. /// GPU rendering will not be enabled if this is set to false.
/// </remarks> /// </remarks>
public bool? AllowEglInitialization { get; set; } public bool? AllowEglInitialization { get; set; }
public IList<string> EglRendererBlacklist { get; set; } = new List<string>
{
"Microsoft Basic Render"
};
/// <summary> /// <summary>
/// Enables multitouch support. The default value is true. /// Enables multitouch support. The default value is true.

Loading…
Cancel
Save