diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-03-27 13:58:14 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-03-27 14:27:11 (GMT) |
commit | e48709416ad314f30d8ea35fc386cb177bb4b32d (patch) | |
tree | 8a90ad831055f409224c0c10d3a1fc55f7411bab /src/gui/painting/qpainterpath.cpp | |
parent | 95d189ee0df74497d70449f3967a38c67f5860ae (diff) | |
download | Qt-e48709416ad314f30d8ea35fc386cb177bb4b32d.zip Qt-e48709416ad314f30d8ea35fc386cb177bb4b32d.tar.gz Qt-e48709416ad314f30d8ea35fc386cb177bb4b32d.tar.bz2 |
Fix very slow stroking of paths in X11 paint engine.
Use QStroker::setRect() to avoid dashing parts of the path that are
outside the device rect.
Task-number: 246573
Reviewed-by: Trond
Diffstat (limited to 'src/gui/painting/qpainterpath.cpp')
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index bb07f81..70036e1 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -2387,21 +2387,13 @@ void qt_path_stroke_cubic_to(qfixed c1x, qfixed c1y, \sa QPen, QBrush */ -class QPainterPathStrokerPrivate +QPainterPathStrokerPrivate::QPainterPathStrokerPrivate() + : dashOffset(0) { -public: - QPainterPathStrokerPrivate() - : dashOffset(0) - { - stroker.setMoveToHook(qt_path_stroke_move_to); - stroker.setLineToHook(qt_path_stroke_line_to); - stroker.setCubicToHook(qt_path_stroke_cubic_to); - } - - QStroker stroker; - QVector<qfixed> dashPattern; - qreal dashOffset; -}; + stroker.setMoveToHook(qt_path_stroke_move_to); + stroker.setLineToHook(qt_path_stroke_line_to); + stroker.setCubicToHook(qt_path_stroke_cubic_to); +} /*! Creates a new stroker. @@ -2445,6 +2437,7 @@ QPainterPath QPainterPathStroker::createStroke(const QPainterPath &path) const QDashStroker dashStroker(&d->stroker); dashStroker.setDashPattern(d->dashPattern); dashStroker.setDashOffset(d->dashOffset); + dashStroker.setClipRect(d->stroker.clipRect()); dashStroker.strokePath(path, &stroke, QTransform()); } stroke.setFillRule(Qt::WindingFill); |