cabana/cameraview: Scale the glViewPort by devicePixelRatio() (#27941)
* cameraview: Scale the glViewPort by devicePixelRatio()
This fixes an issue seen in Cabana on a "hidpi" system with Wayland where
devicePixelRatio() != 1 and the video doesn't take up the full widget area.
On the recommended Ubuntu 20.04 install I wasn't able to reproduce, because
devicePixelRatio() was always equal to 1 even with scaling to 200% or 300%. It
might be different if "Fractional Scaling" is enabled in GNOME (I couldn't make
that option work in mv WM.)
Was going to enable just for Linux, but it appears to also be recommended for
Retina MacOS:
https://doc.qt.io/qt-5/scalability.html#high-dpi-scaling-on-macos-and-ios
... so have worked from the assumption that glViewport() always takes dimensions
in device pixels, never the "device independent pixels" of Qt.
* Update selfdrive/ui/qt/widgets/cameraview.cc
* Update selfdrive/ui/qt/widgets/cameraview.cc
---------
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: fbcd0821c9
beeps
parent
e20b612a20
commit
f1e674f30c
2 changed files with 15 additions and 2 deletions
Loading…
Reference in new issue