AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.29k stars 2.19k forks source link

Size render layers to content. #1983

Closed grokys closed 2 years ago

grokys commented 5 years ago

Render layers currently fill the entire window, no matter the size of the content - this is very wasteful! We make render layers be no larger than they need to be. #1634 tried to address this, but the issue was more complicated:

Particularly, I'm concerned what will happen if a layer needs to change size? Will the whole layer be redrawn? If not, what if the layer needs to expand to the left or the top? Will the existing layer content be shifted over correctly?

Sorien commented 5 years ago

maybe it's not such a good idea to have hundreds small layers, i'd say that some kind layer atlas would be more suitable

Gillibald commented 5 years ago

This change would make it easier to apply effects I guess. If you look how layering is done with Direct2D1 you will see that they have LayerParameters that define the size of the layer. Still wondering what prevents us to use the platforms layering capability instead of managing layers on our own.

kekekeks commented 2 years ago

We don't have layers anymore