Browse Source
Merge pull request #7968 from AvaloniaUI/feature/win32-gpu-blacklist
add win32 egl gpu blacklist.
pull/7317/merge
Jumar Macato
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
21 additions and
2 deletions
-
src/Windows/Avalonia.Win32/Win32GlManager.cs
-
src/Windows/Avalonia.Win32/Win32Platform.cs
|
|
|
@ -24,9 +24,23 @@ namespace Avalonia.Win32 |
|
|
|
{ |
|
|
|
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; |
|
|
|
|
|
|
|
@ -56,6 +56,11 @@ namespace Avalonia |
|
|
|
/// GPU rendering will not be enabled if this is set to false.
|
|
|
|
/// </remarks>
|
|
|
|
public bool? AllowEglInitialization { get; set; } |
|
|
|
|
|
|
|
public IList<string> EglRendererBlacklist { get; set; } = new List<string> |
|
|
|
{ |
|
|
|
"Microsoft Basic Render" |
|
|
|
}; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Enables multitouch support. The default value is true.
|
|
|
|
|