Make QT_SCALE_FACTOR work on Wayland
authorMorten Johan Sørvig <morten.sorvig@theqtcompany.com>
Thu, 6 Aug 2015 20:42:18 +0000 (22:42 +0200)
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>
Thu, 13 Aug 2015 18:28:28 +0000 (18:28 +0000)
Propagate the line stride when creating the high-dpi
backing store image.

Change-Id: I15f41965d8eaf1d01ddac0a1a012b71148f757e3
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
src/gui/painting/qbackingstore.cpp

index 68ed3eae6e6b2a01dac924a274e772289d6dd7bf..8a5a6d4fcf12bf0df6b190b4630f3ab9df671e3a 100644 (file)
@@ -182,7 +182,8 @@ void QBackingStore::beginPaint(const QRegion &region)
             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()