summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index a34c264..5176444 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -1682,11 +1682,23 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
if (!s->penData.blend)
return;
- if (s->flags.fast_pen && path.shape() <= QVectorPath::NonCurvedShapeHint && s->lastPen.brush().isOpaque()) {
- strokePolygonCosmetic((QPointF *) path.points(), path.elementCount(),
- path.hasImplicitClose()
- ? WindingMode
- : PolylineMode);
+ if (s->flags.fast_pen && path.shape() <= QVectorPath::NonCurvedShapeHint
+ && s->lastPen.brush().isOpaque()) {
+ int count = path.elementCount();
+ QPointF *points = (QPointF *) path.points();
+ const QPainterPath::ElementType *types = path.elements();
+ int first = 0;
+ int last;
+ while (first < count) {
+ while (first < count && types[first] != QPainterPath::MoveToElement) ++first;
+ last = first + 1;
+ while (last < count && types[last] == QPainterPath::LineToElement) ++last;
+ strokePolygonCosmetic(points + first, last - first,
+ path.hasImplicitClose() && last == count // only close last one..
+ ? WindingMode
+ : PolylineMode);
+ first = last;
+ }
} else if (s->flags.non_complex_pen && path.shape() == QVectorPath::LinesHint) {
qreal width = s->lastPen.isCosmetic()