diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-10-16 07:55:28 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-10-22 16:44:05 (GMT) |
commit | 5de213210ef4f14e698c3fd970cf7e6c5b27c72d (patch) | |
tree | da5d692ff2dec2ed835cc698ee7770d93351830d /src/gui/kernel/qwidget_p.h | |
parent | a392366b164081fe3b75c806dbf2030e64754eaf (diff) | |
download | Qt-5de213210ef4f14e698c3fd970cf7e6c5b27c72d.zip Qt-5de213210ef4f14e698c3fd970cf7e6c5b27c72d.tar.gz Qt-5de213210ef4f14e698c3fd970cf7e6c5b27c72d.tar.bz2 |
Added caching of graphics effect source pixmaps to speed up effects.
If an effect is applied repeatedly on the same source, just with
varying parameters, we can save a lot by caching the source pixmaps.
Reviewed-by: Bjørn Erik Nilsen
Diffstat (limited to 'src/gui/kernel/qwidget_p.h')
-rw-r--r-- | src/gui/kernel/qwidget_p.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index f7c2712..a109f32 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -360,6 +360,7 @@ public: void setOpaque(bool opaque); void updateIsTranslucent(); bool paintOnScreen() const; + void invalidateGraphicsEffectsRecursively(); QRegion getOpaqueRegion() const; const QRegion &getOpaqueChildren() const; @@ -729,7 +730,7 @@ class QWidgetEffectSourcePrivate : public QGraphicsEffectSourcePrivate { public: QWidgetEffectSourcePrivate(QWidget *widget) - : QGraphicsEffectSourcePrivate(), m_widget(widget), context(0) + : QGraphicsEffectSourcePrivate(), m_widget(widget), context(0), updateDueToGraphicsEffect(false) {} inline void detach() @@ -742,7 +743,11 @@ public: { return m_widget; } inline void update() - { m_widget->update(); } + { + updateDueToGraphicsEffect = true; + m_widget->update(); + updateDueToGraphicsEffect = false; + } inline bool isPixmap() const { return false; } @@ -754,7 +759,7 @@ public: if (QWidget *parent = m_widget->parentWidget()) parent->update(); else - m_widget->update(); + update(); } inline const QStyleOption *styleOption() const @@ -769,6 +774,8 @@ public: QWidget *m_widget; QWidgetPaintContext *context; + QTransform lastEffectTransform; + bool updateDueToGraphicsEffect; }; inline QWExtra *QWidgetPrivate::extraData() const |