diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-05-27 00:46:40 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-05-27 00:46:40 (GMT) |
commit | 411678df3e25304b105e5f3afc849b529baa0d6f (patch) | |
tree | f80a983b5146c6d9b34356bcd4c3de3d8c84134e | |
parent | 861f0fcd140232e8fe94122d640ab69a7c116663 (diff) | |
download | Qt-411678df3e25304b105e5f3afc849b529baa0d6f.zip Qt-411678df3e25304b105e5f3afc849b529baa0d6f.tar.gz Qt-411678df3e25304b105e5f3afc849b529baa0d6f.tar.bz2 |
Don't really need QPainter::save/restore for render hint mods.
-rw-r--r-- | src/declarative/fx/qfximage.cpp | 10 | ||||
-rw-r--r-- | src/declarative/fx/qfxrect.cpp | 4 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp index 6226e45..55aecd7 100644 --- a/src/declarative/fx/qfximage.cpp +++ b/src/declarative/fx/qfximage.cpp @@ -322,10 +322,9 @@ void QFxImage::paintContents(QPainter &p) if (d->_pix.isNull()) return; - if (d->_smooth) { - p.save(); + QPainter::RenderHints oldHints = p.renderHints(); + if (d->_smooth) p.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->_smooth); - } QSimpleCanvasConfig::Image pix = d->_pix; @@ -415,9 +414,8 @@ void QFxImage::paintContents(QPainter &p) QRect(pix.width()-sgr, pix.height() - sgb, sgr, sgb)); } - if (d->_smooth) { - p.restore(); - } + if (d->_smooth) + p.setRenderHints(oldHints); } #elif defined(QFX_RENDER_OPENGL) uint QFxImage::glSimpleItemData(float *vertices, float *texVertices, diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp index 90170da..cc5afc3 100644 --- a/src/declarative/fx/qfxrect.cpp +++ b/src/declarative/fx/qfxrect.cpp @@ -505,7 +505,7 @@ void QFxRect::drawRect(QPainter &p) if (d->_gradcolor.isValid() /*|| p.usingQt() */) { // XXX This path is still slower than the image path // Image path won't work for gradients though - p.save(); + QPainter::RenderHints oldHints = p.renderHints(); p.setRenderHint(QPainter::Antialiasing); if (d->_pen && d->_pen->isValid()) { QPen pn(QColor(pen()->color()), pen()->width()); @@ -525,7 +525,7 @@ void QFxRect::drawRect(QPainter &p) p.drawRoundedRect(0, 0, width(), height(), d->_radius, d->_radius); else p.drawRect(0, 0, width(), height()); - p.restore(); + p.setRenderHints(oldHints); } else { int offset = 0; const int pw = d->_pen && d->_pen->isValid() ? (d->_pen->width()+1)/2*2 : 0; |