From d38118c80828eecb3c0192404249c1fad5660792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Fri, 3 Jun 2022 11:22:50 +0200 Subject: Make rhiFlush() support custom source DPR The rhiFlush() implementation currently assumes that QWindow->devicePixelRatio() is the correct scale factor for transforming device independent window geometry to source geometry. However, this assumption does not hold if/when we add support for drawing to a rounded-up DPR, with a downscale later in the rhiFlush implementation. Fix this by adding a sourceDevicePixelRatio argument to rhiFlush(), which is set to either QWindow::devicePixelRatio() or QWidget::devicePixelRatio(), depending on from where it is used. Change deviceRect() and friends in qbackingstoredefualtcompositor.cpp to be scale*() functions instead which take a scale factor instead of a QWindow. Update call sites to use srouceDevicePixelRatio where that makes sense. Pick-to: 6.4 Change-Id: Idb7b1e2f36816a201e00f0defe100d2dc079cb17 Reviewed-by: Eirik Aavitsland --- src/gui/painting/qplatformbackingstore.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui/painting/qplatformbackingstore.h') diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h index bfb40fe5e0..a1bae50555 100644 --- a/src/gui/painting/qplatformbackingstore.h +++ b/src/gui/painting/qplatformbackingstore.h @@ -154,6 +154,7 @@ public: virtual void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); virtual FlushResult rhiFlush(QWindow *window, + qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, -- cgit v1.2.3