diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-09-29 14:28:02 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-12-08 22:25:50 +0000 |
commit | 7c401397a4ce6c00652306204c9f8477040a5400 (patch) | |
tree | d73ec11b728a249399a0ce8860eb4dc001d8e07e /src/gui/painting/qpaintengine_raster.cpp | |
parent | 7a93d98f29fca9f1610f3b61b055535916903500 (diff) |
Cleanup memrotate functions
Throw out unused code and simply format table to only care about bpp
and use it consistently for all bpp.
Also makes QImage use the 180 degree memrotate, and fixes the tiled
packed qt_memrotate270 so it can be put to use.
Change-Id: If4ef1666fca960ce8e4ce32d85dc5f347b6986f4
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index d8aa727328..647bd5cb2c 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2297,8 +2297,9 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe && d->rasterBuffer->compositionMode == QPainter::CompositionMode_Source))) { RotationType rotationType = qRotationType(s->matrix); + const QPixelLayout::BPP plBpp = qPixelLayouts[d->rasterBuffer->format].bpp; - if (rotationType != NoRotation && qMemRotateFunctions[d->rasterBuffer->format][rotationType] && img.rect().contains(sr.toAlignedRect())) { + if (rotationType != NoRotation && qMemRotateFunctions[plBpp][rotationType] && img.rect().contains(sr.toAlignedRect())) { QRectF transformedTargetRect = s->matrix.mapRect(r); if ((!(s->renderHints & QPainter::SmoothPixmapTransform) && !(s->renderHints & QPainter::Antialiasing)) @@ -2328,7 +2329,7 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe uint cw = clippedSourceRect.width(); uint ch = clippedSourceRect.height(); - qMemRotateFunctions[d->rasterBuffer->format][rotationType](srcBase, cw, ch, sbpl, dstBase, dbpl); + qMemRotateFunctions[plBpp][rotationType](srcBase, cw, ch, sbpl, dstBase, dbpl); return; } |