summaryrefslogtreecommitdiff
path: root/src/gui/image
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2010-03-08 13:38:08 +0100
committerSamuel Rødal <sroedal@trolltech.com>2010-03-26 10:48:59 +0100
commit348d22c37611066dc7efc9aac820d77bcf3bbbab (patch)
tree2def91d28881b2ec809bf1eb4a64a71b08090530 /src/gui/image
parent8d5ae9bca2cbe8c5a7f764b8ba325f79c0bbfe62 (diff)
downloadqt4-tools-348d22c37611066dc7efc9aac820d77bcf3bbbab.tar.gz
Included ARM NEON optimizations from pixman in Qt.
On the N900 16 bit text blending is 30 - 50 % faster, and ARGB32PM on RGB16 image blending now runs in 1/10th of the time it used to. We now make ARGB32PM the default pixmap format for alpha pixmaps instead of ARGB8565PM which is unaligned and bad for performance. The relevant numbers: Mostly opaque pixels: ARGB24 on ARGB24 using QPainter..................: 336,813033 ARGB32 on ARGB32 using QPainter.................: 18,419387 RGB16 on ARGB24 using QPainter..................: 167,301014 RGB16 on ARGB32 using QPainter..................: 17,279372 ARGB24 on RGB16 using QPainter..................: 35,100147 ARGB32PM on RGB16 using QPainter................: 15,924256 No opaque pixels: ARGB24 on ARGB24 using QPainter..................: 412,190765 ARGB32 on ARGB32 using QPainter.................: 16,818389 RGB16 on ARGB24 using QPainter..................: 170,957878 RGB16 on ARGB32 using QPainter..................: 16,742984 ARGB24 on RGB16 using QPainter..................: 93,600482 ARGB32PM on RGB16 using QPainter................: 15,999310 So switching to ARGB32PM should give a boost in all areas. Task-number: QTBUG-6684 Reviewed-by: Gunnar Sletta
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qpixmap_raster.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 0b1c18d438..b183d0d185 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -182,6 +182,7 @@ void QRasterPixmapData::fromImage(const QImage &sourceImage,
QImage::Format opaqueFormat = QNativeImage::systemFormat();
QImage::Format alphaFormat = QImage::Format_ARGB32_Premultiplied;
+#ifndef QT_HAVE_NEON
switch (opaqueFormat) {
case QImage::Format_RGB16:
alphaFormat = QImage::Format_ARGB8565_Premultiplied;
@@ -189,6 +190,7 @@ void QRasterPixmapData::fromImage(const QImage &sourceImage,
default: // We don't care about the others...
break;
}
+#endif
if (!sourceImage.hasAlphaChannel()
|| ((flags & Qt::NoOpaqueDetection) == 0
@@ -238,6 +240,7 @@ void QRasterPixmapData::fill(const QColor &color)
if (alpha != 255) {
if (!image.hasAlphaChannel()) {
QImage::Format toFormat;
+#ifndef QT_HAVE_NEON
if (image.format() == QImage::Format_RGB16)
toFormat = QImage::Format_ARGB8565_Premultiplied;
else if (image.format() == QImage::Format_RGB666)
@@ -247,6 +250,7 @@ void QRasterPixmapData::fill(const QColor &color)
else if (image.format() == QImage::Format_RGB444)
toFormat = QImage::Format_ARGB4444_Premultiplied;
else
+#endif
toFormat = QImage::Format_ARGB32_Premultiplied;
image = QImage(image.width(), image.height(), toFormat);
}