summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem_p.h
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-11-25 09:27:25 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-11-25 18:10:12 (GMT)
commitaae664552f7e5fba96ab6f334ec354800ad83c06 (patch)
tree1f751ae1f2a7bab8d624c65d333fedf62f2e3079 /src/gui/graphicsview/qgraphicsitem_p.h
parentdab1b98d84293e863c920add25980393fad2e9cd (diff)
downloadQt-aae664552f7e5fba96ab6f334ec354800ad83c06.zip
Qt-aae664552f7e5fba96ab6f334ec354800ad83c06.tar.gz
Qt-aae664552f7e5fba96ab6f334ec354800ad83c06.tar.bz2
Remove caching of QGraphicsItem::clipPath().
The cache was added in 4.5 and was useful at that time. With 4.6 it is not relevant anymore since the only use case for it is item-lookup releated to mouse events and collision detection, so the overhead of maintaining the cache is more pain than gain. All existing auto tests pass.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h32
1 files changed, 1 insertions, 31 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 75c8246..013fce1 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -152,8 +152,6 @@ public:
dirty(0),
dirtyChildren(0),
localCollisionHack(0),
- dirtyClipPath(1),
- emptyClipPath(0),
inSetPosHelper(0),
needSortChildren(1), // ### can be 0 by default?
allChildrenDirty(0),
@@ -307,26 +305,6 @@ public:
QGraphicsItemCache *extraItemCache() const;
void removeExtraItemCache();
- inline void setCachedClipPath(const QPainterPath &path)
- {
- cachedClipPath = path;
- dirtyClipPath = 0;
- emptyClipPath = 0;
- }
-
- inline void setEmptyCachedClipPath()
- {
- emptyClipPath = 1;
- dirtyClipPath = 0;
- }
-
- void setEmptyCachedClipPathRecursively(const QRectF &emptyIfOutsideThisRect = QRectF());
-
- inline void invalidateCachedClipPath()
- { /*static int count = 0 ;qWarning("%i", ++count);*/ dirtyClipPath = 1; emptyClipPath = 0; }
-
- void invalidateCachedClipPathRecursively(bool childrenOnly = false, const QRectF &emptyIfOutsideThisRect = QRectF());
- void updateCachedClipPathFromSetPosHelper(const QPointF &newPos);
void ensureSceneTransformRecursive(QGraphicsItem **topMostDirtyItem);
inline void ensureSceneTransform()
{
@@ -409,17 +387,12 @@ public:
return true;
}
- inline bool isClippedAway() const
- { return !dirtyClipPath && q_func()->isClipped() && (emptyClipPath || cachedClipPath.isEmpty()); }
-
inline bool childrenClippedToShape() const
{ return (flags & QGraphicsItem::ItemClipsChildrenToShape) || children.isEmpty(); }
inline bool isInvisible() const
{
- return !visible
- || (childrenClippedToShape() && isClippedAway())
- || (childrenCombineOpacity() && isFullyTransparent());
+ return !visible || (childrenCombineOpacity() && isFullyTransparent());
}
void setFocusHelper(Qt::FocusReason focusReason, bool climb);
@@ -435,7 +408,6 @@ public:
inline void sendScenePosChange();
virtual void siblingOrderChange();
- QPainterPath cachedClipPath;
QRectF childrenBoundingRect;
QRectF needsRepaint;
QMap<QWidget *, QRect> paintedViewBoundingRects;
@@ -480,8 +452,6 @@ public:
quint32 dirty : 1;
quint32 dirtyChildren : 1;
quint32 localCollisionHack : 1;
- quint32 dirtyClipPath : 1;
- quint32 emptyClipPath : 1;
quint32 inSetPosHelper : 1;
quint32 needSortChildren : 1;
quint32 allChildrenDirty : 1;