diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2010-03-25 14:47:18 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2010-03-26 09:49:16 (GMT) |
commit | 5e2b330aaa0ef964d45f9cb60ea258b33d6e7c4a (patch) | |
tree | 8eee830c84c4662b7d286d1559edca51ac89821b /src/gui | |
parent | fa44a37174f51f3d2786fc6e60d8fa5561a4df6c (diff) | |
download | Qt-5e2b330aaa0ef964d45f9cb60ea258b33d6e7c4a.zip Qt-5e2b330aaa0ef964d45f9cb60ea258b33d6e7c4a.tar.gz Qt-5e2b330aaa0ef964d45f9cb60ea258b33d6e7c4a.tar.bz2 |
Optimized ARGB32PM on RGB16 blending with opacity using NEON.
Use the blend_8_pixels_argb32_on_rgb16_neon function that was introduced
in an earlier commit.
Before:
traces/qmlsamegame.trace, iterations: 3, frames: 15, min(ms): 63,
median(ms): 64, stddev: 1,275776 %, max(fps): 238,095238
After:
traces/qmlsamegame.trace, iterations: 3, frames: 15, min(ms): 57,
median(ms): 58, stddev: 0,817464 %, max(fps): 263,157895
Task-number: QTBUG-6684
Reviewed-by: Gunnar Sletta
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qdrawhelper_neon.cpp | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp index 946e100..ee5f24a 100644 --- a/src/gui/painting/qdrawhelper_neon.cpp +++ b/src/gui/painting/qdrawhelper_neon.cpp @@ -162,19 +162,47 @@ void qt_blend_rgb16_on_argb32_neon(uchar *destPixels, int dbpl, pixman_composite_src_0565_8888_asm_neon(w, h, dst, dbpl, src, sbpl); } +extern "C" void blend_8_pixels_argb32_on_rgb16_neon(quint16 *dst, const quint32 *src, int const_alpha); + void qt_blend_argb32_on_rgb16_neon(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha) { + quint16 *dst = (quint16 *) destPixels; + quint32 *src = (quint32 *) srcPixels; + if (const_alpha != 256) { - qt_blend_argb32_on_rgb16_const_alpha(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); + for (int y=0; y<h; ++y) { + int i = 0; + for (; i < w-7; i += 8) + blend_8_pixels_argb32_on_rgb16_neon(&dst[i], &src[i], const_alpha); + + if (i < w) { + int tail = w - i; + + quint16 dstBuffer[8]; + quint32 srcBuffer[8]; + + for (int j = 0; j < tail; ++j) { + dstBuffer[j] = dst[i + j]; + srcBuffer[j] = src[i + j]; + } + + blend_8_pixels_argb32_on_rgb16_neon(dstBuffer, srcBuffer, const_alpha); + + for (int j = 0; j < tail; ++j) { + dst[i + j] = dstBuffer[j]; + src[i + j] = srcBuffer[j]; + } + } + + dst = (quint16 *)(((uchar *) dst) + dbpl); + src = (quint32 *)(((uchar *) src) + sbpl); + } return; } - quint16 *dst = (quint16 *) destPixels; - quint32 *src = (quint32 *) srcPixels; - pixman_composite_over_8888_0565_asm_neon(w, h, dst, dbpl / 2, src, sbpl / 4); } @@ -325,7 +353,6 @@ void qt_alphamapblit_quint16_neon(QRasterBuffer *rasterBuffer, pixman_composite_over_n_8_0565_asm_neon(mapWidth, mapHeight, dest, destStride, color, 0, mask, mapStride); } -extern "C" void blend_8_pixels_argb32_on_rgb16_neon(quint16 *dst, const quint32 *src, int const_alpha); extern "C" void blend_8_pixels_rgb16_on_rgb16_neon(quint16 *dst, const quint16 *src, int const_alpha); template <typename SRC, typename BlendFunc> |