diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-11-10 12:35:42 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-11-10 12:52:35 (GMT) |
commit | 637d6b26d778189a767e28b80aa316cf327e67a2 (patch) | |
tree | 8ac632c593c4f2827d9a95bc6bba4d82467c24ff /src/opengl/qgraphicsshadereffect.cpp | |
parent | dc551cdc3422631baab50860c1a46711e3079f18 (diff) | |
download | Qt-637d6b26d778189a767e28b80aa316cf327e67a2.zip Qt-637d6b26d778189a767e28b80aa316cf327e67a2.tar.gz Qt-637d6b26d778189a767e28b80aa316cf327e67a2.tar.bz2 |
Improvements to graphics effects API after review round.
* Get rid of QGraphicsEffectSource from the public API, instead add
convenience functions in QGraphicsEffect. This way we commit to less
API, and are free to introduce a customizable QGraphicsEffectSource
in a future release.
* Move PixmapPadMode into QGraphicsEffect and tweak the names of the
enum values.
* Make QGraphicsBlurEffect::BlurHint into a bit flag, for extensibility.
Reviewed-by: Bjørn Erik Nilsen
Diffstat (limited to 'src/opengl/qgraphicsshadereffect.cpp')
-rw-r--r-- | src/opengl/qgraphicsshadereffect.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/opengl/qgraphicsshadereffect.cpp b/src/opengl/qgraphicsshadereffect.cpp index 1c02fd0..4d7a69c 100644 --- a/src/opengl/qgraphicsshadereffect.cpp +++ b/src/opengl/qgraphicsshadereffect.cpp @@ -241,7 +241,7 @@ void QGraphicsShaderEffect::setPixelShaderFragment(const QByteArray& code) /*# \reimp */ -void QGraphicsShaderEffect::draw(QPainter *painter, QGraphicsEffectSource *source) +void QGraphicsShaderEffect::draw(QPainter *painter) { Q_D(QGraphicsShaderEffect); @@ -256,13 +256,13 @@ void QGraphicsShaderEffect::draw(QPainter *painter, QGraphicsEffectSource *sourc bool usingShader = d->customShaderStage->setOnPainter(painter); QPoint offset; - if (source->isPixmap()) { + if (sourceIsPixmap()) { // No point in drawing in device coordinates (pixmap will be scaled anyways). - const QPixmap pixmap = source->pixmap(Qt::LogicalCoordinates, &offset); + const QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset); painter->drawPixmap(offset, pixmap); } else { // Draw pixmap in device coordinates to avoid pixmap scaling. - const QPixmap pixmap = source->pixmap(Qt::DeviceCoordinates, &offset); + const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset); QTransform restoreTransform = painter->worldTransform(); painter->setWorldTransform(QTransform()); painter->drawPixmap(offset, pixmap); @@ -273,7 +273,7 @@ void QGraphicsShaderEffect::draw(QPainter *painter, QGraphicsEffectSource *sourc if (usingShader) d->customShaderStage->removeFromPainter(painter); #else - source->draw(painter); + drawSource(painter); #endif } |