Browse Source
* Add failing test for stencil buffer default, single-source the policy Stencil buffer selection was duplicated as `useStencilBuffers == false` across the GL, Metal and Vulkan backends, so there was no single place to review or test the default. Move it to SkiaOptions.ShouldAvoidStencilBuffers and add a test asserting the contract the default should honour. The test fails at this commit. * Avoid stencil buffers unless explicitly enabled Enabling stencil buffers lets Skia select multisample-based path rendering, which quantizes edge coverage instead of computing analytic coverage. Vector geometry therefore rasterizes with visibly softer, rougher edges on GPU backends, most noticeably on small icons. Text is unaffected because glyphs are drawn from the mask atlas rather than the path renderer. Make the null default avoid stencil buffers again, restoring 12.0.5 rendering. Applications that want the faster clipping can still opt in explicitly with SkiaOptions.UseStencilBuffers = true. Fixes #21760pull/22069/head
committed by
GitHub
5 changed files with 32 additions and 5 deletions
@ -0,0 +1,19 @@ |
|||
using Xunit; |
|||
|
|||
namespace Avalonia.Skia.UnitTests |
|||
{ |
|||
public class SkiaOptionsTests |
|||
{ |
|||
// Stencil buffers let Skia choose multisample-based path rendering, which quantizes edge
|
|||
// coverage and visibly degraded vector geometry anti-aliasing on GPU backends in 12.1.0.
|
|||
// They are a performance opt-in, so anything other than an explicit `true` must avoid them.
|
|||
[Theory] |
|||
[InlineData(null, true)] |
|||
[InlineData(false, true)] |
|||
[InlineData(true, false)] |
|||
public void Stencil_Buffers_Are_Avoided_Unless_Explicitly_Enabled(bool? useStencilBuffers, bool expected) |
|||
{ |
|||
Assert.Equal(expected, SkiaOptions.ShouldAvoidStencilBuffers(useStencilBuffers)); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue