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/qpaintengine_x11.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/qpaintengine_x11.cpp')
-rw-r--r-- | src/gui/painting/qpaintengine_x11.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 32cb63d..d931f55 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -62,6 +62,7 @@ #include <private/qpaintengine_x11_p.h> #include <private/qfontengine_x11_p.h> #include <private/qwidget_p.h> +#include <private/qpainterpath_p.h> #include "qpen.h" #include "qcolor.h" @@ -1756,9 +1757,11 @@ void QX11PaintEngine::drawPath(const QPainterPath &path) QPainterPath stroke; qreal width = d->cpen.widthF(); QPolygonF poly; + QRectF deviceRect(0, 0, d->pdev->width(), d->pdev->height()); // necessary to get aliased alphablended primitives to be drawn correctly if (d->cpen.isCosmetic() || d->has_scaling_xform) { stroker.setWidth(width == 0 ? 1 : width * d->xform_scale); + stroker.d_ptr->stroker.setClipRect(deviceRect); stroke = stroker.createStroke(path * d->matrix); if (stroke.isEmpty()) return; @@ -1766,6 +1769,7 @@ void QX11PaintEngine::drawPath(const QPainterPath &path) d->fillPath(stroke, QX11PaintEnginePrivate::PenGC, false); } else { stroker.setWidth(width); + stroker.d_ptr->stroker.setClipRect(d->matrix.inverted().mapRect(deviceRect)); stroke = stroker.createStroke(path); if (stroke.isEmpty()) return; |