Round the image scaling when not antialiased
When painting an image with antialiasing not turned on, round the target area to closest integers (pixels). Task-number: QTBUG-116297 Change-Id: I64e78a9087ee042aef0ea297c48b5ead36697d10 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> (cherry picked from commit 743c1cf96bae2722ac70a551c7d66b7d2f6a65d8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
bf2bc292a8
commit
f4cd58a9b7
@ -2342,9 +2342,16 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
|
||||
}
|
||||
SrcOverScaleFunc func = qScaleFunctions[d->rasterBuffer->format][img.format()];
|
||||
if (func && (!clip || clip->hasRectClip)) {
|
||||
QRectF tr = qt_mapRect_non_normalizing(r, s->matrix);
|
||||
if (!s->flags.antialiased) {
|
||||
tr.setX(qRound(tr.x()));
|
||||
tr.setY(qRound(tr.y()));
|
||||
tr.setWidth(qRound(tr.width()));
|
||||
tr.setHeight(qRound(tr.height()));
|
||||
}
|
||||
func(d->rasterBuffer->buffer(), d->rasterBuffer->bytesPerLine(),
|
||||
img.bits(), img.bytesPerLine(), img.height(),
|
||||
qt_mapRect_non_normalizing(r, s->matrix), sr,
|
||||
tr, sr,
|
||||
!clip ? d->deviceRect : clip->clipRect,
|
||||
s->intOpacity);
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user