summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-09-04 00:58:36 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-09-04 00:58:36 (GMT)
commit3d209a098d9abf5f8ffe9b64b27adbe622e84497 (patch)
treeab89339d66bd6bb4d6a92f829212081ef41ff748
parent373e090de85ee8c46cbd400d4b5fbf37d4b59eae (diff)
downloadQt-3d209a098d9abf5f8ffe9b64b27adbe622e84497.zip
Qt-3d209a098d9abf5f8ffe9b64b27adbe622e84497.tar.gz
Qt-3d209a098d9abf5f8ffe9b64b27adbe622e84497.tar.bz2
Smooth the rendering in the tiles, not of the tiles.
Turn smoothing on in webbrowsser demo.
-rw-r--r--demos/declarative/webbrowser/webbrowser.qml2
-rw-r--r--src/declarative/fx/qfxpainteditem.cpp14
2 files changed, 4 insertions, 12 deletions
diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml
index 6217019..9a8af29 100644
--- a/demos/declarative/webbrowser/webbrowser.qml
+++ b/demos/declarative/webbrowser/webbrowser.qml
@@ -190,7 +190,7 @@ Item {
}
url: fixUrl(WebBrowser.urlString)
- smooth: false
+ smooth: true
fillColor: "white"
focus: true
diff --git a/src/declarative/fx/qfxpainteditem.cpp b/src/declarative/fx/qfxpainteditem.cpp
index 695236d..cbd00cf 100644
--- a/src/declarative/fx/qfxpainteditem.cpp
+++ b/src/declarative/fx/qfxpainteditem.cpp
@@ -208,12 +208,6 @@ void QFxPaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidge
++inpaint;
- bool oldAntiAliasing = p->testRenderHint(QPainter::Antialiasing);
- bool oldSmoothPixmap = p->testRenderHint(QPainter::SmoothPixmapTransform);
- if (oldAntiAliasing)
- p->setRenderHints(QPainter::Antialiasing, false); // cannot stitch properly otherwise
- if (d->smooth)
- p->setRenderHints(QPainter::SmoothPixmapTransform, true);
QRectF clipf = p->clipRegion().boundingRect();
if (clipf.isEmpty())
clipf = mapToScene(content).boundingRect(); // ### Inefficient: Maps toScene and then fromScene
@@ -234,6 +228,7 @@ void QFxPaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidge
if (!d->cachefrozen) {
if (!d->imagecache[i]->dirty.isNull() && topaint.contains(d->imagecache[i]->dirty)) {
QPainter qp(&d->imagecache[i]->image);
+ qp.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform, d->smooth);
qp.translate(-area.x(), -area.y());
if (d->fillColor.isValid())
qp.fillRect(d->imagecache[i]->dirty,d->fillColor);
@@ -280,6 +275,8 @@ void QFxPaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidge
img.fill(d->fillColor);
{
QPainter qp(&img);
+ qp.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform, d->smooth);
+
qp.translate(-r.x(),-r.y());
drawContents(&qp, r);
}
@@ -296,11 +293,6 @@ void QFxPaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidge
}
}
- if (oldAntiAliasing)
- p->setRenderHints(QPainter::Antialiasing, oldAntiAliasing);
- if (d->smooth)
- p->setRenderHints(QPainter::SmoothPixmapTransform, oldSmoothPixmap);
-
if (inpaint_clearcache) {
clearCache();
inpaint_clearcache = 0;