From 0df002ad600800a6c4ccadb969e1b1de7f8353e7 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Mon, 22 Nov 2010 14:56:14 +0100 Subject: Fix non-stroked filled paths in OpenVG paint engine. The QPainter::fillRect() functions are optimizations to avoid state changes in the paint engines. Since these functions should be completely independant of state, ideally they should only call functions that are also stateless. QVGPaintEngine::fillRect() has two different code paths for this. The vgClearRect() path of this function is stateless however in the case of non-opaque or complex fills, this code path cannot be used and instead we use the normal path fill function which is not entirely stateless because ensureTransform() will apply the aliased coordinate transform if the current state includes a stroked pen. To avoid this happening for a pure fill (no stroke) we temporary set the pen state to be Qt::NoPen such that the state used by ensureTransform() is correct. Task-number: QTBUG-14717 Reviewed-by: Jani Hautakangas --- src/openvg/qpaintengine_vg.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index aea203f..03d756d 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -1502,7 +1502,10 @@ void QVGPaintEnginePrivate::fill(VGPath path, const QBrush& brush, VGint rule) return; ensureBrush(brush); setFillRule(rule); + QPen savedPen = currentPen; + currentPen = Qt::NoPen; ensurePathTransform(); + currentPen = savedPen; vgDrawPath(path, VG_FILL_PATH); } -- cgit v0.12