From 8f747efcc14e2f3114821c2c2bfbc3991610890e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 6 Aug 2015 22:42:18 +0200 Subject: [PATCH] Make QT_SCALE_FACTOR work on Wayland Propagate the line stride when creating the high-dpi backing store image. Change-Id: I15f41965d8eaf1d01ddac0a1a012b71148f757e3 Reviewed-by: Paul Olav Tvete --- src/gui/painting/qbackingstore.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index 68ed3eae6e..8a5a6d4fcf 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -182,7 +182,8 @@ void QBackingStore::beginPaint(const QRegion ®ion) qCDebug(lcScaling) << "QBackingStore::beginPaint new backingstore for" << d_ptr->window; qCDebug(lcScaling) << " source size" << source->size() << "dpr" << source->devicePixelRatio(); d_ptr->highDpiBackingstore.reset( - new QImage(source->bits(), source->width(), source->height(), source->format())); + new QImage(source->bits(), source->width(), source->height(), source->bytesPerLine(), source->format())); + qreal targetDevicePixelRatio = d_ptr->window->devicePixelRatio(); d_ptr->highDpiBackingstore->setDevicePixelRatio(targetDevicePixelRatio); qCDebug(lcScaling) <<" destination size" << d_ptr->highDpiBackingstore->size()