From 03026973700f1fcdff602dffa3d94b04912acd44 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 30 Nov 2017 09:43:44 +0100 Subject: QtGui: port away from QRegion::rects() Use begin()/end()/rectCount() instead, which don't require QRegionPrivate ::vectorize() calls. In QPaintEngineEx::clip(), the rectCount() == 1 case called clip(QRect), but forgot to return, causing another clip(QVectorPath) call with the same arguments. Fixed. Change-Id: Ife33112fc8006ed4bdff6409e2b8465ce7acb9d1 Reviewed-by: Lars Knoll --- src/gui/painting/qpaintengine_raster.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gui/painting/qpaintengine_raster.cpp') diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index d0d948bbb7..873303f78e 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3782,8 +3782,8 @@ void QClipData::initialize() } } else if (hasRegionClip) { - const QVector rects = clipRegion.rects(); - const int numRects = rects.size(); + const auto rects = clipRegion.begin(); + const int numRects = clipRegion.rectCount(); { // resize const int maxSpans = (ymax - ymin) * numRects; @@ -3797,8 +3797,8 @@ void QClipData::initialize() int firstInBand = 0; count = 0; while (firstInBand < numRects) { - const int currMinY = rects.at(firstInBand).y(); - const int currMaxY = currMinY + rects.at(firstInBand).height(); + const int currMinY = rects[firstInBand].y(); + const int currMaxY = currMinY + rects[firstInBand].height(); while (y < currMinY) { m_clipLines[y].spans = 0; @@ -3807,7 +3807,7 @@ void QClipData::initialize() } int lastInBand = firstInBand; - while (lastInBand + 1 < numRects && rects.at(lastInBand+1).top() == y) + while (lastInBand + 1 < numRects && rects[lastInBand+1].top() == y) ++lastInBand; while (y < currMaxY) { @@ -3816,7 +3816,7 @@ void QClipData::initialize() m_clipLines[y].count = lastInBand - firstInBand + 1; for (int r = firstInBand; r <= lastInBand; ++r) { - const QRect &currRect = rects.at(r); + const QRect &currRect = rects[r]; QSpan *span = m_spans + count; span->x = currRect.x(); span->len = currRect.width(); -- cgit v1.2.3