diff options
author | Bjoern Erik Nilsen <bnilsen@trolltech.com> | 2009-02-26 14:00:08 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-04-06 11:37:38 (GMT) |
commit | e9fa8ba1ad0b0b2d3363fb33635071677f42b983 (patch) | |
tree | a55bf506f10d64be5bd43001609f4005caa634df /src/gui/graphicsview/qgraphicsview.cpp | |
parent | be6be8c73929f2ddee9a02f59db05c3ba453a63e (diff) | |
download | Qt-e9fa8ba1ad0b0b2d3363fb33635071677f42b983.zip Qt-e9fa8ba1ad0b0b2d3363fb33635071677f42b983.tar.gz Qt-e9fa8ba1ad0b0b2d3363fb33635071677f42b983.tar.bz2 |
Fixes: Cleanup calls to QGraphicsViewPrivate::updateRect()/updateRegion()
Details: Checking for QRect::isNull() was wrong in the first place, and
checking for isEmpty()/isNull() is overhead after
4a491a84aeba68279927597a261522dcc23bb3ff.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsview.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index aa5f069..b92c886 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -829,17 +829,10 @@ void QGraphicsViewPrivate::itemUpdated(QGraphicsItem *item, const QRectF &rect) // Map the rect to view coordinates. QRect vr = viewport->rect(); - if (!item->d_ptr->hasBoundingRegionGranularity) { - QRect r = mapToViewRect(item, updateRect) & vr; - if (r.isNull()) - return; - this->updateRect(r); - } else { - QRegion r = mapToViewRegion(item, updateRect) & vr; - if (r.isEmpty()) - return; - updateRegion(r); - } + if (!item->d_ptr->hasBoundingRegionGranularity) + this->updateRect(mapToViewRect(item, updateRect) & vr); + else + updateRegion(mapToViewRegion(item, updateRect) & vr); } void QGraphicsViewPrivate::updateLater() @@ -863,9 +856,7 @@ void QGraphicsViewPrivate::_q_updateLaterSlot() for (int i = 0; i < dirtyItems.size(); ++i) { const QGraphicsItem *item = dirtyItems.at(i); QTransform x = item->sceneTransform() * viewTransform; - QRect viewRect = x.mapRect(item->boundingRect()).toAlignedRect() & vr; - if (!viewRect.isNull()) - updateRect(viewRect); + updateRect(x.mapRect(item->boundingRect()).toAlignedRect() & vr); } dirtyRectCount += dirtyRects.size(); |