summaryrefslogtreecommitdiff
path: root/src/plugins/platforms/directfb
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-02-27 14:34:46 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-03-02 21:01:00 +0000
commit9c1d3bc253abd4418f3050d19ec5f05bef3ada97 (patch)
tree18dfa273d29c98936114a1ced9062d7174b121ba /src/plugins/platforms/directfb
parent9d3a41556224bb116d51fd8ee25a28317af67b22 (diff)
downloadqtbase-9c1d3bc253abd4418f3050d19ec5f05bef3ada97.tar.gz
QtOpenGL/plugins/platformsupport: use new QRegion::begin()/end() instead of rect()
Saves e.g. ~900b and ~2900b in text size in QtOpenGL and XcbQpa libs, resp., on optimized GCC 5.3 Linux AMD64 builds. Change-Id: Id904689164ca32df41118a23747c70048d8e6604 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/directfb')
-rw-r--r--src/plugins/platforms/directfb/qdirectfbbackingstore.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/plugins/platforms/directfb/qdirectfbbackingstore.cpp b/src/plugins/platforms/directfb/qdirectfbbackingstore.cpp
index e47a00e9ea..ebb8dc1571 100644
--- a/src/plugins/platforms/directfb/qdirectfbbackingstore.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbbackingstore.cpp
@@ -70,9 +70,7 @@ void QDirectFbBackingStore::flush(QWindow *, const QRegion &region, const QPoint
{
m_pmdata->blittable()->unlock();
- QVector<QRect> rects = region.rects();
- for (int i = 0 ; i < rects.size(); i++) {
- const QRect rect = rects.at(i);
+ for (const QRect &rect : region) {
DFBRegion dfbReg = { rect.x() + offset.x(),rect.y() + offset.y(),rect.right() + offset.x(),rect.bottom() + offset.y()};
m_dfbSurface->Flip(m_dfbSurface.data(), &dfbReg, DFBSurfaceFlipFlags(DSFLIP_BLIT|DSFLIP_ONSYNC));
}
@@ -108,11 +106,8 @@ bool QDirectFbBackingStore::scroll(const QRegion &area, int dx, int dy)
if (area.rectCount() == 1) {
scrollSurface(m_dfbSurface.data(), area.boundingRect(), dx, dy);
} else {
- const QVector<QRect> rects = area.rects();
- const int n = rects.size();
- for (int i=0; i<n; ++i) {
- scrollSurface(m_dfbSurface.data(), rects.at(i), dx, dy);
- }
+ for (const QRect &rect : area)
+ scrollSurface(m_dfbSurface.data(), rect, dx, dy);
}
return true;
}