Mark changed regions dirty instead of bounding box of changes

This helps a bit with LinuxFB on low end devices.

Change-Id: I16fcce23e7073272d1d1c6bc660c255163b96c30
Fixes: QTBUG-88174
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Joni Poikelin 2020-10-22 15:21:34 +03:00
parent 039d3fe4e8
commit 8d5b7df0b6

View File

@ -138,14 +138,14 @@ void QFbWindow::lower()
void QFbWindow::repaint(const QRegion &region) void QFbWindow::repaint(const QRegion &region)
{ {
const QRect currentGeometry = geometry(); const QRect currentGeometry = geometry();
const QRect dirtyClient = region.boundingRect();
const QRect dirtyRegion = dirtyClient.translated(currentGeometry.topLeft());
const QRect oldGeometryLocal = mOldGeometry; const QRect oldGeometryLocal = mOldGeometry;
mOldGeometry = currentGeometry; mOldGeometry = currentGeometry;
// If this is a move, redraw the previous location // If this is a move, redraw the previous location
if (oldGeometryLocal != currentGeometry) if (oldGeometryLocal != currentGeometry)
platformScreen()->setDirty(oldGeometryLocal); platformScreen()->setDirty(oldGeometryLocal);
platformScreen()->setDirty(dirtyRegion); auto topLeft = currentGeometry.topLeft();
for (auto rect : region)
platformScreen()->setDirty(rect.translated(topLeft));
} }
QT_END_NAMESPACE QT_END_NAMESPACE