summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainterpath.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-03-27 13:58:14 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-03-27 14:27:11 (GMT)
commite48709416ad314f30d8ea35fc386cb177bb4b32d (patch)
tree8a90ad831055f409224c0c10d3a1fc55f7411bab /src/gui/painting/qpainterpath.cpp
parent95d189ee0df74497d70449f3967a38c67f5860ae (diff)
downloadQt-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.cpp21
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);