summaryrefslogtreecommitdiffstats
path: root/src/openvg
diff options
context:
space:
mode:
authorJason Barron <jason.barron@nokia.com>2010-09-22 13:41:40 (GMT)
committerJason Barron <jason.barron@nokia.com>2010-09-23 09:54:59 (GMT)
commit74f09c794d5fdcb8f4b547b1c55bcd512ef07b95 (patch)
tree36bc9fa60902e28e7d6aaaeb4d17e99b45e19388 /src/openvg
parent0aad0d2043e061469b7139483c489dc6f823490b (diff)
downloadQt-74f09c794d5fdcb8f4b547b1c55bcd512ef07b95.zip
Qt-74f09c794d5fdcb8f4b547b1c55bcd512ef07b95.tar.gz
Qt-74f09c794d5fdcb8f4b547b1c55bcd512ef07b95.tar.bz2
Avoid OpenVG rendering errors when stroking an aliased path.
Stroking a path can sometimes result in inconsistent rendering especially when combined with a clip. For example, if the logical edge of a clip rect coincides with the logical edge of a path then it can happen that the edge is not painted correctly because the stroke lies outside the bounds of the clip rect. To workaround this problem, we add the 'aliasedCoordinateDelta' such that the rounding will err on the side of caution. This improves the correctness when using the raster engine as a reference. Task-number: QTBUG-13165 Reviewed-by: Samuel
Diffstat (limited to 'src/openvg')
-rw-r--r--src/openvg/qpaintengine_vg.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 3c2fd3d..74395a2 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -248,7 +248,11 @@ public:
inline void ensurePathTransform()
{
if (!pathTransformSet) {
- setTransform(VG_MATRIX_PATH_USER_TO_SURFACE, pathTransform);
+ QTransform aliasedTransform = pathTransform;
+ if (renderingQuality == VG_RENDERING_QUALITY_NONANTIALIASED && currentPen != Qt::NoPen)
+ aliasedTransform = aliasedTransform
+ * QTransform::fromTranslate(aliasedCoordinateDelta, -aliasedCoordinateDelta);
+ setTransform(VG_MATRIX_PATH_USER_TO_SURFACE, aliasedTransform);
pathTransformSet = true;
}
}
@@ -306,6 +310,7 @@ inline void QVGPaintEnginePrivate::setRenderingQuality(VGRenderingQuality mode)
if (renderingQuality != mode) {
vgSeti(VG_RENDERING_QUALITY, mode);
renderingQuality = mode;
+ pathTransformSet = false; // need to tweak transform for aliased stroking
}
}