diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2013-03-05 14:43:50 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-14 06:33:33 (GMT) |
commit | 82b2df405962aae03f8a4ea1cf3028fbac0eff57 (patch) | |
tree | f8d4c0ef1daf757a3481d4eea05da7b0620bf8fd /src/gui/painting/qpaintengine_raster.cpp | |
parent | 74cdd38caeb6b8df7375d507ef4364e937d1edf7 (diff) | |
download | Qt-82b2df405962aae03f8a4ea1cf3028fbac0eff57.zip Qt-82b2df405962aae03f8a4ea1cf3028fbac0eff57.tar.gz Qt-82b2df405962aae03f8a4ea1cf3028fbac0eff57.tar.bz2 |
Fixed dashes being rendered differently depending on system clip.
We need to clip lines to the unclipped device rect in the case of
dashing, since otherwise the dashes will be shifted and rendered
differently when partial repaints are done.
Task-number: QTBUG-24762
Change-Id: I3599b54baa552acc20bf8cc2e12f846b45f6019e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
(cherry picked from commit a12f6ba302e54c1570c54aa4c722f2dafbf794af)
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index acc48d3..fe17ace 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1056,20 +1056,20 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt, void QRasterPaintEnginePrivate::systemStateChanged() { - QRect clipRect(0, 0, + deviceRectUnclipped = QRect(0, 0, qMin(QT_RASTER_COORD_LIMIT, device->width()), qMin(QT_RASTER_COORD_LIMIT, device->height())); if (!systemClip.isEmpty()) { - QRegion clippedDeviceRgn = systemClip & clipRect; + QRegion clippedDeviceRgn = systemClip & deviceRectUnclipped; deviceRect = clippedDeviceRgn.boundingRect(); baseClip->setClipRegion(clippedDeviceRgn); } else { - deviceRect = clipRect; + deviceRect = deviceRectUnclipped; baseClip->setClipRect(deviceRect); } #ifdef QT_DEBUG_DRAW - qDebug() << "systemStateChanged" << this << "deviceRect" << deviceRect << clipRect << systemClip; + qDebug() << "systemStateChanged" << this << "deviceRect" << deviceRect << deviceRectUnclipped << systemClip; #endif exDeviceRect = deviceRect; @@ -1536,7 +1536,7 @@ void QRasterPaintEngine::drawRects(const QRect *rects, int rectCount) if (s->penData.blend) { QRectVectorPath path; if (s->flags.fast_pen) { - QCosmeticStroker stroker(s, d->deviceRect); + QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped); for (int i = 0; i < rectCount; ++i) { path.set(rects[i]); stroker.drawPath(path); @@ -1582,7 +1582,7 @@ void QRasterPaintEngine::drawRects(const QRectF *rects, int rectCount) if (s->penData.blend) { QRectVectorPath path; if (s->flags.fast_pen) { - QCosmeticStroker stroker(s, d->deviceRect); + QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped); for (int i = 0; i < rectCount; ++i) { path.set(rects[i]); stroker.drawPath(path); @@ -1615,7 +1615,7 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen) return; if (s->flags.fast_pen) { - QCosmeticStroker stroker(s, d->deviceRect); + QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped); stroker.drawPath(path); } else if (s->flags.non_complex_pen && path.shape() == QVectorPath::LinesHint) { qreal width = s->lastPen.isCosmetic() @@ -1953,7 +1953,7 @@ void QRasterPaintEngine::drawPolygon(const QPointF *points, int pointCount, Poly if (s->penData.blend) { QVectorPath vp((qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode)); if (s->flags.fast_pen) { - QCosmeticStroker stroker(s, d->deviceRect); + QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped); stroker.drawPath(vp); } else { QPaintEngineEx::stroke(vp, s->lastPen); @@ -2024,7 +2024,7 @@ void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, Polyg QVectorPath vp((qreal *) fpoints.data(), pointCount, 0, QVectorPath::polygonFlags(mode)); if (s->flags.fast_pen) { - QCosmeticStroker stroker(s, d->deviceRect); + QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped); stroker.drawPath(vp); } else { QPaintEngineEx::stroke(vp, s->lastPen); @@ -3216,7 +3216,7 @@ void QRasterPaintEngine::drawPoints(const QPointF *points, int pointCount) return; } - QCosmeticStroker stroker(s, d->deviceRect); + QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped); stroker.drawPoints(points, pointCount); } @@ -3235,7 +3235,7 @@ void QRasterPaintEngine::drawPoints(const QPoint *points, int pointCount) return; } - QCosmeticStroker stroker(s, d->deviceRect); + QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped); stroker.drawPoints(points, pointCount); } @@ -3255,7 +3255,7 @@ void QRasterPaintEngine::drawLines(const QLine *lines, int lineCount) return; if (s->flags.fast_pen) { - QCosmeticStroker stroker(s, d->deviceRect); + QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped); for (int i=0; i<lineCount; ++i) { const QLine &l = lines[i]; stroker.drawLine(l.p1(), l.p2()); @@ -3326,7 +3326,7 @@ void QRasterPaintEngine::drawLines(const QLineF *lines, int lineCount) if (!s->penData.blend) return; if (s->flags.fast_pen) { - QCosmeticStroker stroker(s, d->deviceRect); + QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped); for (int i=0; i<lineCount; ++i) { QLineF line = lines[i]; stroker.drawLine(line.p1(), line.p2()); |