diff options
author | Anders Bakken <anders.bakken@nokia.com> | 2009-07-22 18:54:01 (GMT) |
---|---|---|
committer | Anders Bakken <anders.bakken@nokia.com> | 2009-07-22 18:55:14 (GMT) |
commit | e38aed0bf5ea35db7dc82a943dfffcd31cca4700 (patch) | |
tree | cea1fe5140303a53510d12f2dc2ef29d0db70b3e /src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | |
parent | 18728d2ddd725199017a36cb290c30d6e8c9e647 (diff) | |
download | Qt-e38aed0bf5ea35db7dc82a943dfffcd31cca4700.zip Qt-e38aed0bf5ea35db7dc82a943dfffcd31cca4700.tar.gz Qt-e38aed0bf5ea35db7dc82a943dfffcd31cca4700.tar.bz2 |
Use BatchBlit in flush/exposeRegion
Minor optimization.
Also make sure cursor is drawn in flush even if we're not in Offscreen
mode.
Reviewed-by: TrustMe
Diffstat (limited to 'src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index ae2e38b..1efebd9 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -1204,7 +1204,8 @@ void QDirectFBScreen::exposeRegion(QRegion r, int changing) ? static_cast<QDirectFBWindowSurface*>(s) : 0; if (dfbWindowSurface) { IDirectFBSurface *surface = dfbWindowSurface->directFBSurface(); - if (d_ptr->directFBFlags & BoundingRectFlip || insideWindow.numRects() == 1) { + const int n = insideWindow.numRects(); + if (n == 1 || d_ptr->directFBFlags & BoundingRectFlip) { const QRect source = (insideWindow.boundingRect().intersected(windowGeometry)).translated(-windowGeometry.topLeft()); const DFBRectangle rect = { source.x(), source.y(), source.width(), source.height() @@ -1214,17 +1215,21 @@ void QDirectFBScreen::exposeRegion(QRegion r, int changing) windowGeometry.y() + source.y()); } else { const QVector<QRect> rects = insideWindow.rects(); - const int count = rects.size(); - Q_ASSERT(count > 1); - for (int i=0; i<count; ++i) { + QVarLengthArray<DFBRectangle, 16> dfbRectangles(n); + QVarLengthArray<DFBPoint, 16> dfbPoints(n); + + for (int i=0; i<n; ++i) { const QRect source = (rects.at(i).intersected(windowGeometry)).translated(-windowGeometry.topLeft()); - const DFBRectangle rect = { - source.x(), source.y(), source.width(), source.height() - }; - d_ptr->dfbSurface->Blit(d_ptr->dfbSurface, surface, &rect, - windowGeometry.x() + source.x(), - windowGeometry.y() + source.y()); + DFBRectangle &rect = dfbRectangles[i]; + rect.x = source.x(); + rect.y = source.y(); + rect.w = source.width(); + rect.h = source.height(); + dfbPoints[i].x = (windowGeometry.x() + source.x()); + dfbPoints[i].y = (windowGeometry.y() + source.y()); } + d_ptr->dfbSurface->BatchBlit(d_ptr->dfbSurface, surface, dfbRectangles.constData(), + dfbPoints.constData(), n); } } } |