summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene_p.h
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-06-02 16:53:42 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-06-09 07:32:06 (GMT)
commit95949e7ef88eb14b7b22b06d235603f8581f6aa0 (patch)
tree7290a91ce86144cced01d268af39c5b89c3f62c2 /src/gui/graphicsview/qgraphicsscene_p.h
parent6887a89b0e0ee7a0eaff2adc34ae71ab01e2ba2f (diff)
downloadQt-95949e7ef88eb14b7b22b06d235603f8581f6aa0.zip
Qt-95949e7ef88eb14b7b22b06d235603f8581f6aa0.tar.gz
Qt-95949e7ef88eb14b7b22b06d235603f8581f6aa0.tar.bz2
Cache QGrahicsItem's scene transform.
Invalidating the scene transform is just a matter of setting a bit on the item. Then, when we ask for the item's scene transform, we traverse its ancestors recursively and find the top-most dirty item. The algorithm then backtracks to that item and start calculating the scene transform for the item itself and all its children in the call stack. If the item itself and all its ancestors are "clean", nothing is calculated, only traversed. We use this approach when processing dirty items / drawing items as well. That way we ensure the scene transform is only calculated once when absolutely needed. G'night :)
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsscene_p.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
index 6b4476c..e0c48a6 100644
--- a/src/gui/graphicsview/qgraphicsscene_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_p.h
@@ -258,13 +258,12 @@ public:
const QStyleOptionGraphicsItem *option, QWidget *widget,
bool painterStateProtection);
- void drawSubtreeRecursive(QGraphicsItem *item, QPainter *painter, const QTransform &parentTransform,
- const QTransform &viewTransform,
+ void drawSubtreeRecursive(QGraphicsItem *item, QPainter *painter, const QTransform &viewTransform,
QRegion *exposedRegion, QWidget *widget, QGraphicsView::OptimizationFlags optimizationFlags,
QList<QGraphicsItem *> *topLevelItems = 0, qreal parentOpacity = qreal(1.0));
void markDirty(QGraphicsItem *item, const QRectF &rect = QRectF(), bool invalidateChildren = false,
bool maybeDirtyClipPath = false, bool force = false, bool ignoreOpacity = false);
- void processDirtyItemsRecursive(QGraphicsItem *item, const QTransform &);
+ void processDirtyItemsRecursive(QGraphicsItem *item);
inline void resetDirtyItem(QGraphicsItem *item)
{