summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem_p.h
diff options
context:
space:
mode:
authorBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-03-24 14:50:26 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-06 11:49:47 (GMT)
commit0d959a6c402ea3a3a55d7076d453d4bdbf8dce8e (patch)
treee62dfa5843fea4841e2ad781ed15dad94ddc9e8b /src/gui/graphicsview/qgraphicsitem_p.h
parentdeccc867b244fbc52ca58e21623febbc27310b05 (diff)
downloadQt-0d959a6c402ea3a3a55d7076d453d4bdbf8dce8e.zip
Qt-0d959a6c402ea3a3a55d7076d453d4bdbf8dce8e.tar.gz
Qt-0d959a6c402ea3a3a55d7076d453d4bdbf8dce8e.tar.bz2
Fixes: Discard update requests if possible.
AutoTest: Still pass. Details: Update requests can be discarded if the item itself is clipped away and the item clips all its children to shape. This cut-off is extremely effective (and aggressive:))
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 3e4c269..dabbe53 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -164,8 +164,8 @@ public:
void setPosHelper(const QPointF &pos);
void setVisibleHelper(bool newVisible, bool explicitly, bool update = true);
void setEnabledHelper(bool newEnabled, bool explicitly, bool update = true);
- void updateHelper(const QRectF &rect = QRectF(), bool force = false);
- void fullUpdateHelper(bool childrenOnly = false);
+ void updateHelper(const QRectF &rect = QRectF(), bool force = false, bool maybeDirtyClipPath = false);
+ void fullUpdateHelper(bool childrenOnly = false, bool maybeDirtyClipPath = false);
void resolveEffectiveOpacity(qreal effectiveParentOpacity);
void resolveDepth(int parentDepth);
void invalidateSceneTransformCache();
@@ -256,7 +256,7 @@ public:
{ /*static int count = 0 ;qWarning("%i", ++count);*/ dirtyClipPath = 1; emptyClipPath = 0; }
void invalidateCachedClipPathRecursively(bool childrenOnly = false, const QRectF &emptyIfOutsideThisRect = QRectF());
- void updateCachedClipPathFromSetPosHelper();
+ void updateCachedClipPathFromSetPosHelper(const QPointF &newPos);
inline bool isInvisible() const
{
@@ -267,6 +267,9 @@ public:
inline bool isClippedAway() const
{ return !dirtyClipPath && q_func()->isClipped() && (emptyClipPath || cachedClipPath.isEmpty()); }
+ inline bool discardUpdateRequest() const
+ { return ((flags & QGraphicsItem::ItemClipsChildrenToShape) || children.isEmpty()) && isClippedAway(); }
+
QPainterPath cachedClipPath;
QPointF pos;
qreal z;