diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2010-01-13 11:27:14 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2010-01-13 13:39:13 (GMT) |
commit | 6c56de757f235f7c18c51ba7215acc4127a8510c (patch) | |
tree | 0040f49b0fceedb35e2aad310792a433489c1ae5 /src/gui/effects | |
parent | 826d995ff48a01fffc22eafe7b3127e44ed60496 (diff) | |
download | Qt-6c56de757f235f7c18c51ba7215acc4127a8510c.zip Qt-6c56de757f235f7c18c51ba7215acc4127a8510c.tar.gz Qt-6c56de757f235f7c18c51ba7215acc4127a8510c.tar.bz2 |
Improved performance of translating device coordinate graphics effects.
Don't invalidate the cache if we're only translating and the effect rect
is fully contained within the device rect of the painter.
Task-number: QTBUG-6901
Reviewed-by: Bjørn Erik Nilsen
Diffstat (limited to 'src/gui/effects')
-rw-r--r-- | src/gui/effects/qgraphicseffect.cpp | 5 | ||||
-rw-r--r-- | src/gui/effects/qgraphicseffect_p.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 90145fe..ad23df3 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -374,6 +374,11 @@ QGraphicsEffectSourcePrivate::~QGraphicsEffectSourcePrivate() invalidateCache(); } +void QGraphicsEffectSourcePrivate::setCachedOffset(const QPoint &offset) +{ + m_cachedOffset = offset; +} + void QGraphicsEffectSourcePrivate::invalidateCache(InvalidateReason reason) const { if (m_cachedMode != QGraphicsEffect::PadToEffectiveBoundingRect diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h index 91ad74a..e34dbf9 100644 --- a/src/gui/effects/qgraphicseffect_p.h +++ b/src/gui/effects/qgraphicseffect_p.h @@ -129,8 +129,10 @@ public: QGraphicsEffect::PixmapPadMode mode = QGraphicsEffect::PadToTransparentBorder) const = 0; virtual void effectBoundingRectChanged() = 0; + void setCachedOffset(const QPoint &offset); void invalidateCache(InvalidateReason reason = SourceChanged) const; Qt::CoordinateSystem currentCachedSystem() const { return m_cachedSystem; } + QGraphicsEffect::PixmapPadMode currentCachedMode() const { return m_cachedMode; } friend class QGraphicsScenePrivate; friend class QGraphicsItem; |