summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene.cpp
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@nokia.com>2010-03-07 19:06:05 (GMT)
committerLorn Potter <lorn.potter@nokia.com>2010-03-07 19:06:05 (GMT)
commit987ffcbad3337fd343febb305911298a37ed9b7e (patch)
tree3665886405a5bc5300ef8a1c0522780639f29843 /src/gui/graphicsview/qgraphicsscene.cpp
parent4e605d83b5966b08a82eb54e733c2f37bca6b5d6 (diff)
parent987458462994497f764baf253baca0faabdb63cc (diff)
downloadQt-987ffcbad3337fd343febb305911298a37ed9b7e.zip
Qt-987ffcbad3337fd343febb305911298a37ed9b7e.tar.gz
Qt-987ffcbad3337fd343febb305911298a37ed9b7e.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 6bc02cc..fc311f5 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -4728,31 +4728,18 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
if (sourced->currentCachedSystem() != Qt::LogicalCoordinates
&& sourced->lastEffectTransform != painter->worldTransform())
{
- bool unclipped = false;
if (sourced->lastEffectTransform.type() <= QTransform::TxTranslate
&& painter->worldTransform().type() <= QTransform::TxTranslate)
{
- QRectF itemRect = item->boundingRect();
- if (!item->d_ptr->children.isEmpty())
- itemRect |= item->childrenBoundingRect();
+ QRectF sourceRect = sourced->boundingRect(Qt::DeviceCoordinates);
+ QRect effectRect = sourced->paddedEffectRect(Qt::DeviceCoordinates, sourced->currentCachedMode(), sourceRect);
- QRectF oldSourceRect = sourced->lastEffectTransform.mapRect(itemRect);
- QRectF newSourceRect = painter->worldTransform().mapRect(itemRect);
-
- QRect oldEffectRect = sourced->paddedEffectRect(sourced->currentCachedSystem(), sourced->currentCachedMode(), oldSourceRect);
- QRect newEffectRect = sourced->paddedEffectRect(sourced->currentCachedSystem(), sourced->currentCachedMode(), newSourceRect);
-
- QRect deviceRect(0, 0, painter->device()->width(), painter->device()->height());
- if (deviceRect.contains(oldEffectRect) && deviceRect.contains(newEffectRect)) {
- sourced->setCachedOffset(newEffectRect.topLeft());
- unclipped = true;
- }
+ sourced->setCachedOffset(effectRect.topLeft());
+ } else {
+ sourced->invalidateCache(QGraphicsEffectSourcePrivate::TransformChanged);
}
sourced->lastEffectTransform = painter->worldTransform();
-
- if (!unclipped)
- sourced->invalidateCache(QGraphicsEffectSourcePrivate::TransformChanged);
}
item->d_ptr->graphicsEffect->draw(painter);