diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-11-30 09:43:44 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-12-06 18:30:55 +0000 |
commit | 03026973700f1fcdff602dffa3d94b04912acd44 (patch) | |
tree | ab3c22ea63e11e01573605f9a879edeffb160930 /src/gui/painting/qpaintengine_raster.cpp | |
parent | 85d8975bc999d65d04db9027f66c030574a5caf0 (diff) |
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 <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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<QRect> 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(); |