Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

Clip target rendering context to save GPU time

Open ltetak opened this issue 1 year ago • 3 comments

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

ltetak avatar Dec 12 '23 08:12 ltetak

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).

ltetak avatar Dec 12 '23 08:12 ltetak

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]

avaloniaui-bot avatar Dec 12 '23 09:12 avaloniaui-bot

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]

avaloniaui-bot avatar Feb 06 '24 08:02 avaloniaui-bot

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]

avaloniaui-bot avatar Feb 26 '24 08:02 avaloniaui-bot

Clipping was rewritten in latest master by @kekekeks

maxkatz6 avatar Apr 25 '24 01:04 maxkatz6