From 70d80ddc2a86ebb78d04325048c8161c7b28c4b1 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 19 Mar 2009 04:03:24 -0700 Subject: Optimize fillRects. No need to go through the FillRectangles case which would allocate a bunch of T on the stack. Reviewed-by: Tom Cooksey --- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index fb3ecc9..e8afba3 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -241,7 +241,7 @@ public: void end(); SurfaceCache *surfaceCache; - + QTransform transform; private: // QRegion rectsToClippedRegion(const QRect *rects, int n) const; // QRegion rectsToClippedRegion(const QRectF *rects, int n) const; @@ -252,7 +252,6 @@ private: int fbHeight; quint8 opacity; - QTransform transform; quint32 drawFlags; quint32 blitFlags; @@ -1191,12 +1190,14 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) d->updateClip(); if (d->dfbCanHandleClip(rect) && !d->matrixRotShear) { switch (brush.style()) { - case Qt::SolidPattern: + case Qt::SolidPattern: { d->unlock(); d->updateFlags(); d->setDFBColor(brush.color()); - d->fillRects(&rect, 1); - return; + const QRect r = ::mapRect(d->transform, rect); + d->surface->FillRectangle(d->surface, r.x(), r.y(), + r.width(), r.height()); + return; } case Qt::TexturePattern: if (state()->brushOrigin == QPointF() && brush.transform().isIdentity()) { //could handle certain types of brush.transform() E.g. scale @@ -1225,7 +1226,9 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QColor &color) d->unlock(); d->updateFlags(); d->setDFBColor(color); - d->fillRects(&rect, 1); + const QRect r = ::mapRect(d->transform, rect); + d->surface->FillRectangle(d->surface, r.x(), r.y(), + r.width(), r.height()); } } -- cgit v0.12