diff options
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 19 | ||||
-rw-r--r-- | tests/arthur/data/qps/borderimage.qps | 19 | ||||
-rw-r--r-- | tests/arthur/data/qps/borderimage_qps.png | bin | 90704 -> 91838 bytes |
3 files changed, 33 insertions, 5 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index cbfd5e3..847904b 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2575,9 +2575,10 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe if (!aa && sr.size() == QSize(1, 1)) { // as fillRect will apply the aliased coordinate delta we need to // subtract it here as we don't use it for image drawing - const QRectF targetRect = r.translated(-aliasedCoordinateDelta, - -aliasedCoordinateDelta); - fillRect(targetRect, QColor::fromRgba(img.pixel(sr.x(), sr.y()))); + QTransform old = s->matrix; + s->matrix = s->matrix * QTransform::fromTranslate(-aliasedCoordinateDelta, -aliasedCoordinateDelta); + fillRect(r, QColor::fromRgba(img.pixel(sr.x(), sr.y()))); + s->matrix = old; return; } @@ -2611,6 +2612,18 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe return; d->image_filler_xform.setupMatrix(copy, s->flags.bilinear); + if (!aa && s->matrix.type() == QTransform::TxScale) { + QRectF rr = s->matrix.mapRect(r); + + const int x1 = qRound(rr.x()); + const int y1 = qRound(rr.y()); + const int x2 = qRound(rr.right()); + const int y2 = qRound(rr.bottom()); + + fillRect_normalized(QRect(x1, y1, x2-x1, y2-y1), &d->image_filler_xform, d); + return; + } + #ifdef QT_FAST_SPANS ensureState(); if (s->flags.tx_noshear || s->matrix.type() == QTransform::TxScale) { diff --git a/tests/arthur/data/qps/borderimage.qps b/tests/arthur/data/qps/borderimage.qps index 14073fe..8d2e54b 100644 --- a/tests/arthur/data/qps/borderimage.qps +++ b/tests/arthur/data/qps/borderimage.qps @@ -123,6 +123,21 @@ end_block one_pixel_border resetMatrix +translate 205.1 626.1 +scale 0.4 0.4 + +repeat_block one_pixel_border + +resetMatrix + +translate 255.1 624.1 +scale 0.4 0.4 +rotate 10 + +repeat_block one_pixel_border + +resetMatrix + setPen red drawRect 0 0 70 680 @@ -145,5 +160,5 @@ drawText 174 114 "smoothpixmaptransform off" drawRect 164 128 224 134 drawText 174 252 "smoothpixmaptransform on" -drawRect 200 520 97 128 -drawText 210 638 "1x1 edges" +drawRect 200 520 97 188 +drawText 210 698 "1x1 edges" diff --git a/tests/arthur/data/qps/borderimage_qps.png b/tests/arthur/data/qps/borderimage_qps.png Binary files differindex a4ec6cb..ed51d5f 100644 --- a/tests/arthur/data/qps/borderimage_qps.png +++ b/tests/arthur/data/qps/borderimage_qps.png |