diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-06-17 20:05:28 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-06-17 20:05:28 (GMT) |
commit | f5d119bf15e248634ef02437ffd9b77755262f00 (patch) | |
tree | fb3f8a25f9c9c5bd4105e8ed408dc7da1b6d71f6 /src | |
parent | e920c83084b48db7fe1925c7b98e34794eec6d55 (diff) | |
download | Qt-f5d119bf15e248634ef02437ffd9b77755262f00.zip Qt-f5d119bf15e248634ef02437ffd9b77755262f00.tar.gz Qt-f5d119bf15e248634ef02437ffd9b77755262f00.tar.bz2 |
Small optimization to QGraphicsScenePrivate::drawSubtreeRecursive.
We save three function calls by calling item->paint() directly.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 3f4bdde..71a4f08 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5206,7 +5206,11 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * if (clipsToShape) painter->setClipPath(item->shape(), Qt::IntersectClip); painter->setOpacity(opacity); - drawItemHelper(item, painter, &styleOptionTmp, widget, painterStateProtection); + + if (!item->d_ptr->cacheMode && !item->d_ptr->isWidget) + item->paint(painter, &styleOptionTmp, widget); + else + drawItemHelper(item, painter, &styleOptionTmp, widget, painterStateProtection); if (savePainter) painter->restore(); |