Xpra-org / xpra

Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows.
https://xpra.org/
GNU General Public License v2.0
1.9k stars 164 forks source link

downscale just once #4331

Open totaam opened 3 weeks ago

totaam commented 3 weeks ago

When using a desktop-scaling value lower than 100%, we should also keep the window's back buffer at the downscaled resolution since screen updates may well arrive at this resolution and this is the resolution we want to paint on screen.

Upscaling to the server window size is wasteful and will increase scaling arctifacts.

totaam commented 3 weeks ago

The easiest solution is to just keep the buffer at the same size as the window. Which is not the actual resolution used when painting the screen... because of the "scale-factor". But since the scale factor is always an integer, I guess that's still an improvement? Slightly slower paints, but faster present. Negligible increase in GPU memory usage.

totaam commented 3 weeks ago

But, this would completely break scroll encoding! Because the scroll instructions sent by the server are pixel perfect for the size it knows about. If we need to apply any kind of scaling to the coordinates then we end up blitting half lines and things will look horrible.

I guess the only solution is to special case downscaling. Either altogether avoiding any downscaling server side, or keeping the buffer at the unscaled size client side.