From: Sérgio Martins Date: Fri, 26 Jun 2015 19:40:50 +0000 (+0100) Subject: QRasterPaintEngine: Don't detach QImage X-Git-Tag: v5.5.90+alpha1~18^2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df276787d5bb191da62db632efaeb4256fa5da27;p=platform%2Fupstream%2Fqtbase.git QRasterPaintEngine: Don't detach QImage Caught being detached a few thousand times per second. Change-Id: I6dd5fd69d7d4f32048cdb7e4ac707f24df6c15f8 (cherry picked from commit 2a81516835c680c29f3de9241a8c28027624ce4f) Reviewed-by: Konstantin Ritt Reviewed-by: Allan Sandfeld Jensen --- diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index aabf4a9427..a5957ca86e 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2756,12 +2756,12 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, QFixed spp = fontEngine->subPixelPositionForX(positions[i].x); QPoint offset; - QImage *alphaMap = fontEngine->lockedAlphaMapForGlyph(glyphs[i], spp, neededFormat, s->matrix, - &offset); + const QImage *alphaMap = fontEngine->lockedAlphaMapForGlyph(glyphs[i], spp, neededFormat, s->matrix, + &offset); if (alphaMap == 0 || alphaMap->isNull()) continue; - alphaPenBlt(alphaMap->bits(), alphaMap->bytesPerLine(), alphaMap->depth(), + alphaPenBlt(alphaMap->constBits(), alphaMap->bytesPerLine(), alphaMap->depth(), qFloor(positions[i].x) + offset.x(), qRound(positions[i].y) + offset.y(), alphaMap->width(), alphaMap->height());