Add QCanvasImage::devicePixelRatio() and use it


Take the value from QImage. Use it when calculating implicit (non-user
specified) width and height in drawImage and image patterns. The
behavior should match QPainter and QImage.

QImageReader should automatically set the QImage dpr to 2 when loading
files with @2 suffix, and therefore no further changes are needed
in QCanvasPainter.

Fixes: QTBUG-145183
Pick-to: 6.12
Change-Id: I86a2ff3fd37b66dac9c6051d74067d5052fabdad
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
commit6bb637aae553d8ed6861b7bc7818dede6a2600f3
parent1f99d0195a5075c6963db428733db0e8bd0f4578
authorLaszlo Agocs <laszlo.agocs@qt.io>
committerLaszlo Agocs <laszlo.agocs@qt.io>
commit timeWed, 10 Jun 2026 11:58:57 +0000