summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem_p.h
diff options
context:
space:
mode:
authorBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-03-11 16:24:41 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-06 11:49:41 (GMT)
commit4556bcbd40c8feb7185aae7da5f0686f12d87565 (patch)
treef4be3dda7b316818201e002bde409988d357af1c /src/gui/graphicsview/qgraphicsitem_p.h
parent0985805ab3c7de5b15c115a98afb15944b6d93b9 (diff)
downloadQt-4556bcbd40c8feb7185aae7da5f0686f12d87565.zip
Qt-4556bcbd40c8feb7185aae7da5f0686f12d87565.tar.gz
Qt-4556bcbd40c8feb7185aae7da5f0686f12d87565.tar.bz2
Fixes: Optimization: Cache QGraphicsItem::clipPath().
RevBy: Alexis AutoTest: Still pass Details: No-brainer.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 7deae52..1e2c09b 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -138,6 +138,7 @@ public:
dirty(0),
dirtyChildren(0),
localCollisionHack(0),
+ dirtyClipPath(1),
globalStackingOrder(-1),
sceneTransformIndex(-1),
q_ptr(0)
@@ -234,6 +235,18 @@ public:
QGraphicsItemCache *extraItemCache() const;
void removeExtraItemCache();
+ inline void setCachedClipPath(const QPainterPath &path)
+ {
+ cachedClipPath = path;
+ dirtyClipPath = 0;
+ }
+
+ inline void invalidateCachedClipPath()
+ { dirtyClipPath = 1; }
+
+ void invalidateCachedClipPathRecursively(bool childrenOnly = false);
+
+ QPainterPath cachedClipPath;
QPointF pos;
qreal z;
QGraphicsScene *scene;
@@ -268,6 +281,7 @@ public:
quint32 dirty : 1;
quint32 dirtyChildren : 1;
quint32 localCollisionHack : 1;
+ quint32 dirtyClipPath : 1;
// Optional stacking order
int globalStackingOrder;