diff options
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index d00329b..8b83f02 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2495,10 +2495,7 @@ void QRasterPaintEngine::drawImage(const QPointF &p, const QImage &img) const QClipData *clip = d->clip(); QPointF pt(p.x() + s->matrix.dx(), p.y() + s->matrix.dy()); - // ### TODO: remove this eventually... - static bool NO_BLEND_FUNC = !qgetenv("QT_NO_BLEND_FUNCTIONS").isNull(); - - if (s->flags.fast_images && !NO_BLEND_FUNC) { + if (s->flags.fast_images) { SrcOverBlendFunc func = qBlendFunctions[d->rasterBuffer->format][img.format()]; if (func) { if (!clip) { @@ -2511,6 +2508,8 @@ void QRasterPaintEngine::drawImage(const QPointF &p, const QImage &img) } } + + d->image_filler.clip = clip; d->image_filler.initTexture(&img, s->intOpacity, QTextureData::Plain, img.rect()); if (!d->image_filler.blend) @@ -2562,14 +2561,24 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe if (s->matrix.type() > QTransform::TxTranslate || stretch_sr) { if (s->flags.fast_images) { - SrcOverScaleFunc func = qScaleFunctions[d->rasterBuffer->format][img.format()]; - if (func && (!clip || clip->hasRectClip)) { - func(d->rasterBuffer->buffer(), d->rasterBuffer->bytesPerLine(), - img.bits(), img.bytesPerLine(), - qt_mapRect_non_normalizing(r, s->matrix), sr, - !clip ? d->deviceRect : clip->clipRect, - s->intOpacity); - return; + if (s->matrix.type() > QTransform::TxScale) { + SrcOverTransformFunc func = qTransformFunctions[d->rasterBuffer->format][img.format()]; + if (func && (!clip || clip->hasRectClip)) { + func(d->rasterBuffer->buffer(), d->rasterBuffer->bytesPerLine(), img.bits(), + img.bytesPerLine(), r, sr, !clip ? d->deviceRect : clip->clipRect, + s->matrix, s->intOpacity); + return; + } + } else { + SrcOverScaleFunc func = qScaleFunctions[d->rasterBuffer->format][img.format()]; + if (func && (!clip || clip->hasRectClip)) { + func(d->rasterBuffer->buffer(), d->rasterBuffer->bytesPerLine(), + img.bits(), img.bytesPerLine(), + qt_mapRect_non_normalizing(r, s->matrix), sr, + !clip ? d->deviceRect : clip->clipRect, + s->intOpacity); + return; + } } } @@ -4056,7 +4065,7 @@ void QRasterPaintEnginePrivate::recalculateFastImages() s->flags.fast_images = !(s->renderHints & QPainter::SmoothPixmapTransform) && rasterBuffer->compositionMode == QPainter::CompositionMode_SourceOver - && s->matrix.type() <= QTransform::TxScale; + && s->matrix.type() <= QTransform::TxShear; } |