diff options
author | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-06-09 07:05:57 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-06-09 07:43:43 (GMT) |
commit | 03428c4d2905cc73866f1d046b5cc1bedf1c38b3 (patch) | |
tree | 3c10401f0d77c999f9bf83b6b610bc1406024812 /src/gui/graphicsview | |
parent | e4d6cfb1be4a3ff71013362f1f827e3920524934 (diff) | |
download | Qt-03428c4d2905cc73866f1d046b5cc1bedf1c38b3.zip Qt-03428c4d2905cc73866f1d046b5cc1bedf1c38b3.tar.gz Qt-03428c4d2905cc73866f1d046b5cc1bedf1c38b3.tar.bz2 |
Remove one unnecessary argument from the recursive draw function.
We don't have to pass optimization flags; we already have a member
variable we can test for painter state protection.
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 14 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene_p.h | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 2 |
3 files changed, 7 insertions, 11 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 7963ea1..e43c9cd 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5108,7 +5108,6 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *painter, const QTransform &viewTransform, QRegion *exposedRegion, QWidget *widget, - QGraphicsView::OptimizationFlags optimizationFlags, QList<QGraphicsItem *> *topLevelItems, qreal parentOpacity) { @@ -5229,7 +5228,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * if (!(child->d_ptr->flags & QGraphicsItem::ItemStacksBehindParent)) break; drawSubtreeRecursive(child, painter, viewTransform, exposedRegion, widget, - optimizationFlags, 0, opacity); + 0, opacity); } } @@ -5238,7 +5237,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * item->d_ptr->initStyleOption(&styleOptionTmp, transform, exposedRegion ? *exposedRegion : QRegion(), exposedRegion == 0); bool clipsToShape = (item->d_ptr->flags & QGraphicsItem::ItemClipsToShape); - bool savePainter = clipsToShape || !(optimizationFlags & QGraphicsView::DontSavePainterState); + bool savePainter = clipsToShape || painterStateProtection; if (savePainter) painter->save(); if (!childClip) @@ -5261,7 +5260,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * if (wasDirtyParentSceneTransform) child->d_ptr->dirtySceneTransform = 1; drawSubtreeRecursive(child, painter, viewTransform, exposedRegion, - widget, optimizationFlags, 0, opacity); + widget, 0, opacity); } } else if (wasDirtyParentSceneTransform) { item->d_ptr->invalidateChildrenSceneTransform(); @@ -5487,11 +5486,8 @@ void QGraphicsScene::drawItems(QPainter *painter, // Determine view, expose and flags. QGraphicsView *view = widget ? qobject_cast<QGraphicsView *>(widget->parentWidget()) : 0; QRegion *expose = 0; - QGraphicsView::OptimizationFlags flags; - if (view) { + if (view) expose = &view->d_func()->exposedRegion; - flags = view->optimizationFlags(); - } // Find all toplevels, they are already sorted. QList<QGraphicsItem *> topLevelItems; @@ -5500,7 +5496,7 @@ void QGraphicsScene::drawItems(QPainter *painter, if (!item->d_ptr->itemDiscovered) { topLevelItems << item; item->d_ptr->itemDiscovered = 1; - d->drawSubtreeRecursive(item, painter, viewTransform, expose, widget, flags); + d->drawSubtreeRecursive(item, painter, viewTransform, expose, widget); } } diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h index 000e2ba..42c4d8c 100644 --- a/src/gui/graphicsview/qgraphicsscene_p.h +++ b/src/gui/graphicsview/qgraphicsscene_p.h @@ -261,7 +261,7 @@ public: bool painterStateProtection); void drawSubtreeRecursive(QGraphicsItem *item, QPainter *painter, const QTransform &viewTransform, - QRegion *exposedRegion, QWidget *widget, QGraphicsView::OptimizationFlags optimizationFlags, + QRegion *exposedRegion, QWidget *widget, 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); diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index e685f9b..4891e81 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -3303,7 +3303,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event) // Items if (!(d->optimizationFlags & IndirectPainting)) { d->scene->d_func()->drawSubtreeRecursive(0, &painter, viewTransform, &d->exposedRegion, - viewport(), d->optimizationFlags, 0); + viewport(), 0); } else { // Find all exposed items bool allItems = false; |