diff options
author | Anders Bakken <anders.bakken@nokia.com> | 2009-04-07 05:23:01 (GMT) |
---|---|---|
committer | Anders Bakken <anders.bakken@nokia.com> | 2009-04-07 05:23:01 (GMT) |
commit | 13e3bd76869c0e9be2408b0928b87565aa48ae3d (patch) | |
tree | d263c8fcf229b4db0f43fa18afa15c0b2c689f20 /src/plugins | |
parent | 7b72b28464b4ffba6b39cbb863731202dd922064 (diff) | |
download | Qt-13e3bd76869c0e9be2408b0928b87565aa48ae3d.zip Qt-13e3bd76869c0e9be2408b0928b87565aa48ae3d.tar.gz Qt-13e3bd76869c0e9be2408b0928b87565aa48ae3d.tar.bz2 |
Optimize fillRects/fillRegion
This is not X11. There's no need to create another structure to hold the
DFB rectangles. Verified by DirectFB expert.
Reviewed-by: TrustMe
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 4732c65..a93bbf7 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -558,43 +558,25 @@ void QDirectFBPaintEnginePrivate::fillRegion(const QRegion ®ion) const { const QVector<QRect> rects = region.rects(); const int n = rects.size(); - QVarLengthArray<DFBRectangle> dfbRects(n); - - for (int i = 0; i < n; ++i) { - const QRect r = rects.at(i); - dfbRects[i].x = r.x(); - dfbRects[i].y = r.y(); - dfbRects[i].w = r.width(); - dfbRects[i].h = r.height(); - - } - surface->FillRectangles(surface, dfbRects.data(), n); + fillRects(rects.constData(), n); } void QDirectFBPaintEnginePrivate::fillRects(const QRect *rects, int n) const { - QVarLengthArray<DFBRectangle> dfbRects(n); for (int i = 0; i < n; ++i) { const QRect r = transform.mapRect(rects[i]); - dfbRects[i].x = r.x(); - dfbRects[i].y = r.y(); - dfbRects[i].w = r.width(); - dfbRects[i].h = r.height(); + surface->FillRectangle(surface, r.x(), r.y(), + r.width(), r.height()); } - surface->FillRectangles(surface, dfbRects.data(), n); } void QDirectFBPaintEnginePrivate::fillRects(const QRectF *rects, int n) const { - QVarLengthArray<DFBRectangle> dfbRects(n); for (int i = 0; i < n; ++i) { const QRect r = transform.mapRect(rects[i]).toRect(); - dfbRects[i].x = r.x(); - dfbRects[i].y = r.y(); - dfbRects[i].w = r.width(); - dfbRects[i].h = r.height(); + surface->FillRectangle(surface, r.x(), r.y(), + r.width(), r.height()); } - surface->FillRectangles(surface, dfbRects.data(), n); } void QDirectFBPaintEnginePrivate::drawRects(const QRect *rects, int n) const |