Wayland and fractional scaling

Vlad Zahorodnii vlad.zahorodnii at kde.org
Mon Jan 25 10:08:59 GMT 2021


Hi,

On 1/24/21 11:08 AM, Carlos Pita wrote:
> Hi all,
> 
> I would like to ask you a coupleĀ of questions about how fractional 
> scaling is currently implemented in the Wayland compositor if you don't 
> mind.
> 
> I understand that the Wayland protocol only allows to specify an integer 
> scale factor for an app to produce its output. Then the output would be 
> appropriately downscaled, doing some kind of interpolation for the case 
> of non integer scales. AFAICS this approach has serious downsides both 
> in terms of extra processing (for example, at 125% the app has to 
> produce 2 / 1.25 extra pixels in each dimension, hasn't it?) and of 
> degraded output quality (because of the raster operations while 
> downscaling, not as bad as upscaling but still not ideal). Indeed, it's 
> the same thing we have been doing for years with xrandr, albeit at the 
> app level and probably not using bicubic interpolation as xrandr (BTW, 
> which one do you use? Linear? Do you fallback to nearest neighbour for 
> integer scales?).
> 
> OTOH Qt has the ability to directly produce output at the target 
> fractional scale. Other toolkits/frameworks/engines also have this 
> ability, I reckon: Firefox, Chromium and everything Electron based, 
> maybe Flutter, etc. One toolkit that hasn't the ability is GTK.
> 
> So the question is: does KWin somehow special-case Qt apps in order to 
> avoid the extra processing and lower output quality, given that Qt is 

No, it doesn't. Fractional scale factors are rounded up. In order to 
support scale factors such as 125% properly, we need changes in upstream 
protocols. As far as I know, no one has really started working on it.

Cheers,
Vlad

> perfectly capable of directly producing the output at the target scale? 
> If not, what is your opinion about this circumstance? Have you compared 
> the direct fractional output and the "oversampled" output in typical 
> screens (say FHD 13-14'' laptop)? I find Plasma font rendering very high 
> quality and I'm afraid of having to sacrifice that on the altar of Wayland.
> 
> Thank you in advance
> 
> ---
> Carlos


More information about the kwin mailing list