From 5099c57813309bafb9bd3ad9656e1c49712b9dc5 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Tue, 24 Mar 2009 15:53:30 -0700 Subject: Fix flipping. Fixes two bugs with regards to Flip(). We blit'ed the boundingRect of the updated region rather than each rect which is wasteful. More importantly we ignored the offset which would lead to painting errors. Reviewed-by: Tom Cooksey --- .../gfxdrivers/directfb/qdirectfbsurface.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp index 7d5ad10..ce026ea 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp @@ -338,11 +338,22 @@ void QDirectFBSurface::flush(QWidget *widget, const QRegion ®ion, QWSWindowSurface::flush(widget, region, offset); #ifndef QT_NO_DIRECTFB_WM - const QRect br = region.boundingRect().translated(painterOffset()); - const DFBRegion r = { br.x(), br.y(), - br.x() + br.width(), br.y() + br.height() }; - - dfbSurface->Flip(dfbSurface, &r, DSFLIP_NONE); + if (region.numRects() > 1) { + const QVector rects = region.rects(); + for (int i=0; iFlip(dfbSurface, &dfbReg, DSFLIP_ONSYNC); + } + } else { + const QRect r = region.boundingRect(); + const DFBRegion dfbReg = { r.x() + offset.x(), r.y() + offset.y(), + r.x() + r.width() + offset.x(), + r.y() + r.height() + offset.y() }; + dfbSurface->Flip(dfbSurface, &dfbReg, DSFLIP_ONSYNC); + } #endif } -- cgit v0.12