https://bugs.kde.org/show_bug.cgi?id=414266

--- Comment #8 from nyanpasu64 <nyanpas...@tuta.io> ---
>But I don't really follow what you think is a Qt bug with regards to the 
>qt_Matrix. It has to do the mapping between co-ordinates, so what would we 
>change?

qt_Matrix is constructed using the output texture's height and width. Its
current function is to take a point in device-independent pixels (x-right = 0
.. (w/devicePixelRatio), y-down = 0 .. (h/devicePixelRatio)), and convert it to
an OpenGL position (x-right = -1..1, y-up = -1..1) which maps to the the same
point (converted to physical pixels) in the output texture. A symbolic
description of the procedure is as follows:

- Divide x by (w/devicePixelRatio), then multiply by 2 and subtract 1.
- Divide y by (h/devicePixelRatio), then multiply by 2 and subtract 1, then
negate.

However it's currently computed incorrectly, since it rounds w/devicePixelRatio
and h/devicePixelRatio (the output texture size converted to device-independent
pixels) to an integer. At least that's my understanding of what goes wrong,
since I could not find the code that computes qt_Matrix.

Also I think this code will break down even worse if I test on Wayland with
per-monitor scaling factors (I haven't tested the current code or any of my
proposed bugfixes on it, and the current code has some iffy branching off
that).

>You can set a filtering on the QSGTexture. Nodes will follow that.

I tried the following in KQuickStyleItem::updatePaintNode(), and it had no
effect (still nearest-neighbor):

```
    auto texture = window()->createTextureFromImage(m_image, {});
    texture->setFiltering(QSGTexture::Linear);
    styleNode->setTexture(texture);
```

>Ultimately QQC2-desktop-style is a hack. It's not where we want to be going 
>long long term for styling, it's far too many texture uploads. It's just there 
>as we need visual compatibility.

Is it worth fixing the bug or not, by quantizing each scene node to physical
pixels whenever it moves? (I suspect the current approach will never support
rendering scaled/rotated/etc. widgets cleanly. So I have to somehow detect
non-translation transformation, turn off quantization, and turn on linear
interpolation... which doesn't work right now.)

Is https://invent.kde.org/plasma/qqc2-breeze-style mature yet? I don't see any
Arch package supplying it.

----

Additionally I think the texture width/height override code is unused.
KQuickStyleItem::setTextureWidth() sets m_textureWidth, which gets multiplied
by the screen DPI scaling factor when picking a texture width (this feels like
a mistake). Moreover, KQuickStyleItem is a library-private class, only used
internally as the QML type "org.kde.qqc2desktopstyle.private.StyleItem". And
none of the QML files set the textureWidth property, so I think m_textureWidth
is always 0 and this part of the code is dead.

(Code search: https://invent.kde.org/frameworks/qqc2-desktop-style)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to