diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-10-28 13:44:10 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-10-29 09:47:14 (GMT) |
commit | 7d5b560f71e0f11c20b7ebef11f3095e760ca32c (patch) | |
tree | ac8397e1ff54344a5331da055c5707a90851ce68 /src/gui/effects/qgraphicseffect_p.h | |
parent | f5c553078b7381c3dff7d0bd6b9990a7acf86abb (diff) | |
download | Qt-7d5b560f71e0f11c20b7ebef11f3095e760ca32c.zip Qt-7d5b560f71e0f11c20b7ebef11f3095e760ca32c.tar.gz Qt-7d5b560f71e0f11c20b7ebef11f3095e760ca32c.tar.bz2 |
Added some optimizations to the blur and drop shadow GL filters.
* Use ExpandToTransparentBorderPadMode since we can use GL_CLAMP_TO_EDGE
to clamp to the texture.
* Shrink the bounding rects reported by the blur
and drop shadow filters (expanding by 2 * radius isn't needed).
* Use a single-pass blur for radii <= 3 to avoid the overhead of
rendering to an FBO.
* Made the fast blur setting generate filters for only a predefined set
of radii, and then use the actual blur radius to spread the sample
points outwards.
* Optimized the generated program to rely less on temporary variables,
as those seemed to not be handled very well by certain GLSL compilers.
Reviewed-by: Gunnar Sletta
Diffstat (limited to 'src/gui/effects/qgraphicseffect_p.h')
-rw-r--r-- | src/gui/effects/qgraphicseffect_p.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h index dff84a1..1ed7103 100644 --- a/src/gui/effects/qgraphicseffect_p.h +++ b/src/gui/effects/qgraphicseffect_p.h @@ -66,7 +66,12 @@ class QGraphicsEffectSourcePrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QGraphicsEffectSource) public: - QGraphicsEffectSourcePrivate() : QObjectPrivate() {} + QGraphicsEffectSourcePrivate() + : QObjectPrivate() + , m_cachedSystem(Qt::DeviceCoordinates) + , m_cachedMode(QGraphicsEffectSource::ExpandToTransparentBorderPadMode) + {} + virtual ~QGraphicsEffectSourcePrivate() { invalidateCache(); } virtual void detach() = 0; virtual QRectF boundingRect(Qt::CoordinateSystem system) const = 0; @@ -88,6 +93,7 @@ public: private: mutable Qt::CoordinateSystem m_cachedSystem; + mutable QGraphicsEffectSource::PixmapPadMode m_cachedMode; mutable QPoint m_cachedOffset; mutable QPixmapCache::Key m_cacheKey; }; |