mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-12-01 01:17:05 +01:00
3dfcbca711
Steam puts its overlay into the starter, the game it launches. In a window's own redirection surface ANGLE draws through a swap chain of that window, and the overlay hooks its Present and draws the frame counter and notifications over the starter. Every window now draws into a DirectComposition surface, which is drawn without a Present and still keeps away from the WinUI composition visual that came up black on 25H2. The redirection surface stays only as the fallback.
47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
using Avalonia;
|
|
using StarterNG.Infrastructure;
|
|
|
|
namespace StarterNG.Tests;
|
|
|
|
public class WindowSurfacesTests
|
|
{
|
|
[Fact]
|
|
public void Windows_draws_into_a_directcomposition_surface_and_never_through_winui_composition()
|
|
{
|
|
var options = WindowSurfaces.Win32Options;
|
|
|
|
Assert.Equal(Win32CompositionMode.DirectComposition, options.CompositionMode.First());
|
|
Assert.DoesNotContain(Win32CompositionMode.WinUIComposition, options.CompositionMode);
|
|
}
|
|
|
|
[Fact]
|
|
public void The_window_surface_is_only_the_fallback()
|
|
{
|
|
// There ANGLE presents through a swap chain, and the Steam overlay draws over it.
|
|
Assert.Equal(Win32CompositionMode.RedirectionSurface, WindowSurfaces.Win32Options.CompositionMode.Last());
|
|
}
|
|
|
|
[Fact]
|
|
public void No_swap_chain_of_its_own_is_asked_for()
|
|
{
|
|
Assert.DoesNotContain(Win32CompositionMode.LowLatencyDxgiSwapChain, WindowSurfaces.Win32Options.CompositionMode);
|
|
}
|
|
|
|
[Fact]
|
|
public void The_graphics_card_still_draws()
|
|
{
|
|
Assert.Equal(new Win32PlatformOptions().RenderingMode, WindowSurfaces.Win32Options.RenderingMode);
|
|
Assert.Contains(Win32RenderingMode.AngleEgl, WindowSurfaces.Win32Options.RenderingMode);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData(false)]
|
|
[InlineData(true)]
|
|
public void The_options_go_to_the_same_builder_with_or_without_the_processor(bool softwareRender)
|
|
{
|
|
var builder = AppBuilder.Configure<Avalonia.Application>();
|
|
|
|
Assert.Same(builder, WindowSurfaces.ApplyTo(builder, softwareRender));
|
|
}
|
|
}
|