diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-12-11 11:24:23 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-12-14 14:18:36 (GMT) |
commit | 21c31b4a3ae972a4c2f03adebd43a2d6a27f8c93 (patch) | |
tree | 87a9f72381a6119f00fc7e6bbaf291195326c6ab /src/gui/graphicsview | |
parent | 8bbb0e70d189d7027494004a8dece8aeb4e37366 (diff) | |
download | Qt-21c31b4a3ae972a4c2f03adebd43a2d6a27f8c93.zip Qt-21c31b4a3ae972a4c2f03adebd43a2d6a27f8c93.tar.gz Qt-21c31b4a3ae972a4c2f03adebd43a2d6a27f8c93.tar.bz2 |
Added InvalidateReason to invalidateCache to optimize effects
This lets us ignore the invalidateCache call when the transform of a
graphics item with an effect changes, and the cached system is
LogicalCoordinates and cached mode is not PadToEffectiveBoundingRect.
Reviewed-by: Bjørn Erik Nilsen
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 2af90b8..ff3c1bb 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4658,10 +4658,13 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * painter->setWorldTransform(*transformPtr); painter->setOpacity(opacity); - if (sourced->lastEffectTransform != painter->worldTransform()) { + if (sourced->currentCachedSystem() != Qt::LogicalCoordinates + && sourced->lastEffectTransform != painter->worldTransform()) + { sourced->lastEffectTransform = painter->worldTransform(); - sourced->invalidateCache(); + sourced->invalidateCache(QGraphicsEffectSourcePrivate::TransformChanged); } + item->d_ptr->graphicsEffect->draw(painter); painter->setWorldTransform(restoreTransform); sourced->info = 0; |