diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-11-04 01:14:49 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-11-04 01:14:49 (GMT) |
commit | e042014961636d459dc84df93ad2cca96049e2d1 (patch) | |
tree | 483fac9c3e0e88d60527c9675fd0789253204fb4 /src/gui/effects/qgraphicseffect_p.h | |
parent | 25e7b091c44c1cff2f74551a0603e85b4c286260 (diff) | |
parent | 8caacf51667d4cf770b18a8b59e46f842861210e (diff) | |
download | Qt-e042014961636d459dc84df93ad2cca96049e2d1.zip Qt-e042014961636d459dc84df93ad2cca96049e2d1.tar.gz Qt-e042014961636d459dc84df93ad2cca96049e2d1.tar.bz2 |
Merge branch '4.6' of git://scm.dev.nokia.troll.no/qt/qt into kinetic-declarativeui
Conflicts:
configure.exe
src/gui/graphicsview/qgraphicsitem_p.h
Diffstat (limited to 'src/gui/effects/qgraphicseffect_p.h')
-rw-r--r-- | src/gui/effects/qgraphicseffect_p.h | 48 |
1 files changed, 9 insertions, 39 deletions
diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h index fc925f2..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; @@ -77,7 +82,8 @@ public: virtual void draw(QPainter *p) = 0; virtual void update() = 0; virtual bool isPixmap() const = 0; - virtual QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset = 0) const = 0; + virtual QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset = 0, + QGraphicsEffectSource::PixmapPadMode mode = QGraphicsEffectSource::ExpandToTransparentBorderPadMode) const = 0; virtual void effectBoundingRectChanged() = 0; void invalidateCache() const { QPixmapCache::remove(m_cacheKey); } @@ -87,6 +93,7 @@ public: private: mutable Qt::CoordinateSystem m_cachedSystem; + mutable QGraphicsEffectSource::PixmapPadMode m_cachedMode; mutable QPoint m_cachedOffset; mutable QPixmapCache::Key m_cacheKey; }; @@ -118,22 +125,6 @@ public: quint32 padding : 31; // feel free to use }; -class QGraphicsGrayscaleEffectPrivate : public QGraphicsEffectPrivate -{ - Q_DECLARE_PUBLIC(QGraphicsGrayscaleEffect) -public: - QGraphicsGrayscaleEffectPrivate() - : opaque(true) - { - filter = new QPixmapColorizeFilter; - filter->setColor(Qt::black); - } - ~QGraphicsGrayscaleEffectPrivate() { delete filter; } - - QPixmapColorizeFilter *filter; - quint32 opaque : 1; - quint32 padding : 31; -}; class QGraphicsColorizeEffectPrivate : public QGraphicsEffectPrivate { @@ -151,15 +142,6 @@ public: quint32 padding : 31; }; -class QGraphicsPixelizeEffectPrivate : public QGraphicsEffectPrivate -{ - Q_DECLARE_PUBLIC(QGraphicsPixelizeEffect) -public: - QGraphicsPixelizeEffectPrivate() : pixelSize(3) {} - - int pixelSize; -}; - class QGraphicsBlurEffectPrivate : public QGraphicsEffectPrivate { Q_DECLARE_PUBLIC(QGraphicsBlurEffect) @@ -195,18 +177,6 @@ public: uint hasOpacityMask : 1; }; -class QGraphicsBloomEffectPrivate : public QGraphicsEffectPrivate -{ - Q_DECLARE_PUBLIC(QGraphicsBlurEffect) -public: - QGraphicsBloomEffectPrivate() : brightness(70), strength(qreal(0.7)) {} - - QPixmapBlurFilter blurFilter; - int colorTable[256]; - int brightness; - qreal strength; -}; - QT_END_NAMESPACE #endif // QGRAPHICSEFFECT_P_H |