For the first time, actually plugged in my high DPI laptop.
Tested both 1x and 2x windows on 2 real displays one high DPI, one normal
Details
- Reviewers
romangg graesslin - Group Reviewers
Plasma - Commits
- R108:0dac5d6bfe8c: Add scaling to DRM backend
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.
plugins/platforms/drm/scene_qpainter_drm_backend.cpp | ||
---|---|---|
67 | Divding above through scale and then multiplying again here and in blank() could lead to rounding errors. |
Rename Output::size to Output::pixelSize
This mirrors KWayland::Client::Output and is useful
to separate the two co-ordinate spaces.
We have this for buffers, and we use geometry when
we want it all normalised.
Regarding all your Diffs about Scaling, that you haven't yet merged: Can you edit the Related Revisions in Phab, so it's easier to review them? For example for this diff here D3159 is needed.
plugins/platforms/drm/drm_output.cpp | ||
---|---|---|
104 ↗ | (On Diff #12804) | Instead of dividing on every call, declare new private variable QSize m_scaledSize = pixelSize() / scale(), and update its value only when m_mode or the scale value is changed. |
plugins/platforms/drm/drm_output.cpp | ||
---|---|---|
104 ↗ | (On Diff #12804) | What benefit will that have? |
plugins/platforms/drm/drm_output.cpp | ||
---|---|---|
104 ↗ | (On Diff #12804) | geometry() is called several times per frame. We can optimize here when we don't do the division every time (maybe the compiler already does the saving, I don't know). Also this way we can make sure, that the subsequent rounding is not fluctuating from one frame to another. |
plugins/platforms/drm/drm_output.cpp | ||
---|---|---|
104 ↗ | (On Diff #12804) | It's good design to not have member variables that can ever be in a corrupt state, it reduces chance for bugs being introduced later, which is why I'm against changing it. Dividing two integers is not going to make any performance difference whatsoever and an int divided by an int will result in the same every single time. |
plugins/platforms/drm/drm_output.cpp | ||
---|---|---|
104 ↗ | (On Diff #12804) | Ok, fine with me. Can you now expand the testing parameter from the other Diff, so it's possible to use it in DRM mode? I tried to set a hard coded value in DrmOutput::setScale in order to test different scale factors, but the results were garbage, so I think (hope) that this hard coding doesn't set the scale factors elsewhere correctly and the testing parameter is necessary. |