From 807fa90b32466fd936704459884c12214d8a254f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 26 Sep 2017 10:57:04 +0200 Subject: Fix crash with clips entirely outside glyph map When the range to work on is empty just continue to next span. Task-number: QTBUG-63412 Change-Id: Ic5cb77ed438eb9c218f482095aa0cd4e3c2fc6e6 Reviewed-by: Oliver Wolff --- src/gui/painting/qdrawhelper.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index c78fdfe62e..6c25710271 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -5627,6 +5627,8 @@ static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer, int start = qMax(x, clip.x); int end = qMin(x + mapWidth, clip.x + clip.len); + if (end <= start) + continue; Q_ASSERT(end - start <= buffer_size); QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, start, clip.y, end - start); @@ -5900,6 +5902,8 @@ static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer, int start = qMax(x, clip.x); int end = qMin(x + mapWidth, clip.x + clip.len); + if (end <= start) + continue; Q_ASSERT(end - start <= buffer_size); QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, start, clip.y, end - start); -- cgit v1.2.3 From c071413ecca3599d27aab21b7efab0193af5f1d9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 5 Oct 2017 16:54:35 +0200 Subject: Fix zero-length lines with scaling We should calculate the pen width based on the scaling similar to how it is done for normal lines, otherwise we get the scaling applied twice. Task-number: QTBUG-61777 Change-Id: Iba71d55971a1d29537d2c9ff33749223a06160de Reviewed-by: Eirik Aavitsland --- src/gui/painting/qpaintengine_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index ef58f96fbc..92ab6e8375 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1638,7 +1638,7 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen) QPointF p = lines[i].p1(); QLineF line = s->matrix.map(QLineF(QPointF(p.x() - width*0.5, p.y()), QPointF(p.x() + width*0.5, p.y()))); - d->rasterizer->rasterizeLine(line.p1(), line.p2(), 1); + d->rasterizer->rasterizeLine(line.p1(), line.p2(), width / line.length()); } continue; } -- cgit v1.2.3 From bc74273143dfb5de8e2255649c7fd037d3d4075a Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 6 Oct 2017 11:07:14 +0200 Subject: QPainter: fix invalid pen style when drawing misspelled words This code asks the platform theme to resolve SpellCheckUnderline to an actual pen style (wave, solid, dash, etc.) but if there's no theme, or if the default implementation in QPlatformTheme is used, the value is still SpellCheckUnderline, which then casted to a PenStyle below in qpainter.cpp: pen.setStyle((Qt::PenStyle)(underlineStyle)); The value 7 is an invalid PenStyle, which leads to random behavior when drawing the underline. Make it WaveUnderline if the platform theme had no opinion on how to draw it. Change-Id: I4f02f9b58f10582cee5aefce7a4d5cd300133140 Reviewed-by: Frederik Gladhorn --- src/gui/painting/qpainter.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index b186182c34..49d8fd2846 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6259,6 +6259,8 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme(); if (theme) underlineStyle = QTextCharFormat::UnderlineStyle(theme->themeHint(QPlatformTheme::SpellCheckUnderlineStyle).toInt()); + if (underlineStyle == QTextCharFormat::SpellCheckUnderline) // still not resolved + underlineStyle = QTextCharFormat::WaveUnderline; } if (underlineStyle == QTextCharFormat::WaveUnderline) { -- cgit v1.2.3 From 2d4fe257cad8b10f284de7a0b10a1a297026e86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 12 Oct 2017 16:32:07 +0200 Subject: Remove some unused, local variables Change-Id: I453162d2d396bb3427064d3b1593bb6c71376605 Reviewed-by: Friedemann Kleint --- src/gui/painting/qstroker.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp index c52792c2d3..4776545be6 100644 --- a/src/gui/painting/qstroker.cpp +++ b/src/gui/painting/qstroker.cpp @@ -1147,8 +1147,6 @@ void QDashStroker::processCurrentSubpath() QLineF cline; - QPainterPath dashPath; - QSubpathFlatIterator it(&m_elements, m_dashThreshold); qfixed2d prev = it.next(); -- cgit v1.2.3