summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnders Bakken <anders@trolltech.com>2009-03-19 11:03:24 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2009-03-25 15:57:17 (GMT)
commit70d80ddc2a86ebb78d04325048c8161c7b28c4b1 (patch)
tree588bda1fb4fb4283376b05d4f0911cdc8046b7ba /src
parenta71e6490b5415f24e38681015ae05326a004a7b7 (diff)
downloadQt-70d80ddc2a86ebb78d04325048c8161c7b28c4b1.zip
Qt-70d80ddc2a86ebb78d04325048c8161c7b28c4b1.tar.gz
Qt-70d80ddc2a86ebb78d04325048c8161c7b28c4b1.tar.bz2
Optimize fillRects.
No need to go through the FillRectangles case which would allocate a bunch of T on the stack. Reviewed-by: Tom Cooksey
Diffstat (limited to 'src')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp15
1 files 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());
}
}