Fractional scaling in DRM kscreen integration
ClosedPublic

Authored by davidedmundson on Jun 19 2018, 5:21 PM.

Details

Summary

The kwin code was written to treat scale as non integers, we just need
to switch to the relevant float version of methods.

Test Plan

Used kscreen-doctor to change this
Konsole resized as appropriate
Plasmashell was all broken, but that's expected until QScreen::size is based on the
xdg-output virtual size

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Jun 19 2018, 5:21 PM
Restricted Application added a project: KWin. · View Herald TranscriptJun 19 2018, 5:21 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Jun 19 2018, 5:21 PM
mart accepted this revision.Jun 22 2018, 8:46 AM
This revision is now accepted and ready to land.Jun 22 2018, 8:46 AM
zzag added a subscriber: zzag.Jun 22 2018, 9:35 AM
zzag added inline comments.
plugins/platforms/drm/drm_output.cpp
821–828

Formatting nitpick: put a whitespace between // and text.

graesslin accepted this revision.Jun 23 2018, 7:54 AM
romangg requested changes to this revision.Jun 23 2018, 10:57 AM
romangg added a subscriber: romangg.
romangg added inline comments.
plugins/platforms/drm/drm_output.cpp
827

I think we want to ceil. Otherwise you might upscale the client buffers for example from 1 to 1.4 and get blurriness. With ceil you always downscale.

I would have liked to multiply, but a scale of e.g. 1.1 then would result in a scale factor of 10, what is quite many pixels to draw.

This revision now requires changes to proceed.Jun 23 2018, 10:57 AM
plugins/platforms/drm/drm_output.cpp
827

Quite probably. I'd like to see it tested on your relevant device.

Also a big regret from my x scaling is I think I want to allow steps of 8ths instead of 10ths.

In binary they're much more nice round numbers which will always be represented correctly in a double.

add spaces after comment marker

graesslin accepted this revision.Jun 30 2018, 6:21 AM
This revision was not accepted when it landed; it landed in state Needs Review.Aug 6 2018, 9:51 AM
This revision was automatically updated to reflect the committed changes.