Avalonia
Avalonia copied to clipboard
Clip target rendering context to save GPU time
What does the pull request do?
Clip target surface. It helps when there is just a small portion of the screen changing to lower the GPU usage of the app - does not improve the DWM. Should have an impact on all (also non-Windows) platforms though.
What is the current behavior?
The first thing done is Clear on entire surface which touches every pixel. It is very dependent on the window size.
Breaking changes
Should have no visible change.
Fixed issues
Slightly improves https://github.com/AvaloniaUI/Avalonia/discussions/13901
I assume the "layer" is to keep double-buffered targetContext up to date (both buffers). So the question is if it is correct to update only the dirty rect region. If not then maybe we can keep also the previous dirty rect and update union of these two (most of the time it will be the same region).
You can test this PR using the following package version. 11.1.999-cibuild0042822-beta
. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
You can test this PR using the following package version. 11.1.999-cibuild0044499-beta
. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
You can test this PR using the following package version. 11.1.999-cibuild0045352-beta
. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
Clipping was rewritten in latest master by @kekekeks