summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem_p.h
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-05-27 19:31:44 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-06-09 07:26:58 (GMT)
commit63a3c0ad549b57d0896f267383cf671d6212a70e (patch)
tree6e79f410a93cdf69c7582077c5631b98b8868377 /src/gui/graphicsview/qgraphicsitem_p.h
parente7c7e4f57530d7b3571bf11dbe555c52f6dc3f34 (diff)
downloadQt-63a3c0ad549b57d0896f267383cf671d6212a70e.zip
Qt-63a3c0ad549b57d0896f267383cf671d6212a70e.tar.gz
Qt-63a3c0ad549b57d0896f267383cf671d6212a70e.tar.bz2
Massive re-factoring of Graphics View's update mechanism.
This is work-in-progress, so don't expect everything to work perfectly. Most of the auto-test pass and examples and demos seem to run fine. Unfortunately I'm too tired to write about the actual update mehanism now, but it's faster than the old approach (if that helps:)). There's more to optimize, but I'll come back to that later. I need some sleep now :) To be continued.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 200d177..1d4b37a 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -161,6 +161,8 @@ public:
dirtyTransform(0),
dirtyTransformComponents(0),
dirtyChildrenBoundingRect(1),
+ inDirtyList(0),
+ paintedViewBoundingRectsNeedRepaint(0),
globalStackingOrder(-1),
sceneTransformIndex(-1),
q_ptr(0)
@@ -186,8 +188,6 @@ public:
void setEnabledHelper(bool newEnabled, bool explicitly, bool update = true);
bool discardUpdateRequest(bool ignoreClipping = false, bool ignoreVisibleBit = false,
bool ignoreDirtyBit = false, bool ignoreOpacity = false) const;
- void updateHelper(const QRectF &rect = QRectF(), bool force = false, bool maybeDirtyClipPath = false);
- void fullUpdateHelper(bool childrenOnly = false, bool maybeDirtyClipPath = false, bool ignoreOpacity = false);
void updateEffectiveOpacity();
void resolveEffectiveOpacity(qreal effectiveParentOpacity);
void resolveDepth(int parentDepth);
@@ -308,8 +308,22 @@ public:
|| (childrenCombineOpacity() && isFullyTransparent());
}
+ inline bool hasDirtyAncestor() const
+ {
+ QGraphicsItem *p = parent;
+ while (p) {
+ if (p->d_ptr->dirtyChildren || (p->d_ptr->dirty && p->d_ptr->childrenClippedToShape()))
+ return true;
+ p = p->d_ptr->parent;
+ }
+ return false;
+ }
+
+
QPainterPath cachedClipPath;
QRectF childrenBoundingRect;
+ QRectF needsRepaint;
+ QMap<QWidget *, QRect> paintedViewBoundingRects;
QPointF pos;
qreal z;
QGraphicsScene *scene;
@@ -353,7 +367,9 @@ public:
quint32 dirtyTransform : 1;
quint32 dirtyTransformComponents : 1;
quint32 dirtyChildrenBoundingRect : 1;
- quint32 padding : 17; // feel free to use
+ quint32 inDirtyList : 1;
+ quint32 paintedViewBoundingRectsNeedRepaint : 1;
+ quint32 padding : 15; // feel free to use
// Optional stacking order
int globalStackingOrder;