summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnders Bakken <anders@trolltech.com>2009-03-24 22:53:30 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2009-03-25 16:21:32 (GMT)
commit5099c57813309bafb9bd3ad9656e1c49712b9dc5 (patch)
treefb0d93880bed2660aa8fbf2e97c33ee28354da65 /src
parent2ab5d8db650118312bfe9b1e60c4ac60229b229f (diff)
downloadQt-5099c57813309bafb9bd3ad9656e1c49712b9dc5.zip
Qt-5099c57813309bafb9bd3ad9656e1c49712b9dc5.tar.gz
Qt-5099c57813309bafb9bd3ad9656e1c49712b9dc5.tar.bz2
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
Diffstat (limited to 'src')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp21
1 files 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 &region,
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<QRect> rects = region.rects();
+ for (int i=0; i<rects.size(); ++i) {
+ const QRect &r = rects.at(i);
+ 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);
+ }
+ } 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
}