Repository navigation
Enable stencil buffers by default + add configurable option - #21586
Merged
Merged
Conversation
MrJul
force-pushed
the
feature/skia-stencil-options
branch
from
June 15, 2026 10:00
eaed7ad to
e2aafdd
Compare
kekekeks
approved these changes
Jun 15, 2026
Contributor
|
How does this relate to/differ from the (I haven't been able to locate documentation on all these various different rendering options.) |
|
You can test this PR using the following package version. |
MrJul
added this pull request to the merge queue
Jun 15, 2026
Member
Author
They're the same (but with the behavior reversed). This PR exposes Skia's |
15 of 39 tasks
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does the pull request do?
This PR introduces a new option
SkiaOptions.UseStencilBuffersand enables it by default.What is the current behavior?
Stencil buffers were disabled on all platforms a long time ago, in #6896, due to issues on macOS.
What is the updated/expected behavior with this PR?
Stencil buffers are enabled again. All platforms have been tested: Windows, macOS (both GL and Metal), X11, Android, iOS, and Browser. There is no visible clipping issue with Skia m119.
Clipping operations on GPUs should be faster, especially when
CompositionOptions.UseRegionDirtyRectClipping = true(the sample in #21538 goes from 70ms to 16ms render CPU time per frame).This PR also adds a new option,
SkiaOptions.UseStencilBuffers, so users can explicitly disable it without having to recompile Avalonia. The default isnull, which means Avalonia chooses the best behavior depending on the platform (currently: enabled everywhere).