diff options
author | lpapuga <ljubomir.papuga@gmail.com> | 2013-11-20 17:09:57 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-14 18:52:14 +0100 |
commit | f10356ead13e39c9501b84ee5e92efe722a2d2c7 (patch) | |
tree | 930999a0bf8dff0632cc91b72e0610b905b1ca83 /src/gui/painting/qdrawhelper_mips_dsp.cpp | |
parent | 48caaee17016629b1459041e6d8b2fa7a888b62a (diff) |
MIPS DSP build system fix and additional optimizations.
Changed MIPS DSP portion of the mkspecs/features/simd.prf file in order
to fix the corrupted build system for MIPS platforms.
List of the additionally optimized functions
from file src/gui/painting/qdrawhelper.cpp:
- qt_blend_rgb16_on_rgb16
- qt_fetchUntransformed_888
- qt_fetchUntransformed_444
- qt_fetchUntransformed_argb8565
from file src/gui/image/qimage.cpp:
- convert_ARGB_to_ARGB_PM_inplace
from file src/corelib/qstring.cpp:
- ucstrncmp
- toLatin1_helper
- fromLatin1_helper
Change-Id: I5c47a69784917eee29a8dbd2718828a390b27c93
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/painting/qdrawhelper_mips_dsp.cpp')
-rw-r--r-- | src/gui/painting/qdrawhelper_mips_dsp.cpp | 97 |
1 files changed, 96 insertions, 1 deletions
diff --git a/src/gui/painting/qdrawhelper_mips_dsp.cpp b/src/gui/painting/qdrawhelper_mips_dsp.cpp index a9b551c226..2202b78ce8 100644 --- a/src/gui/painting/qdrawhelper_mips_dsp.cpp +++ b/src/gui/painting/qdrawhelper_mips_dsp.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 MIPS Technologies, www.mips.com, author Damir Tatalovic <dtatalovic@mips.com> +** Copyright (C) 2013 Imagination Technologies Limited, www.imgtec.com ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module of the Qt Toolkit. @@ -110,6 +110,78 @@ void qt_blend_rgb32_on_rgb32_mips_dsp(uchar *destPixels, int dbpl, } } +#if defined QT_COMPILER_SUPPORTS_MIPS_DSPR2 +void qt_blend_rgb16_on_rgb16_mips_dspr2(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha) +{ + if (const_alpha == 256) { + if (w < 256) { + const quint16 *src = (const quint16*) srcPixels; + quint16 *dst = (quint16*) destPixels; + for (int y = 0; y < h; ++y) { + qt_blend_rgb16_on_rgb16_const_alpha_256_mips_dsp_asm(dst, src, w); + dst = (quint16*) (((uchar*) dst) + dbpl); + src = (quint16*) (((uchar*) src) + sbpl); + } + } + else { + int length = w << 1; + while (h--) { + memcpy(destPixels, srcPixels, length); + destPixels += dbpl; + srcPixels += sbpl; + } + } + } + else if (const_alpha != 0) { + const quint16 *src = (const quint16*) srcPixels; + quint16 *dst = (quint16*) destPixels; + for (int y = 0; y < h; ++y) { + qt_blend_rgb16_on_rgb16_mips_dspr2_asm(dst, src, w, const_alpha); + dst = (quint16*) (((uchar*) dst) + dbpl); + src = (quint16*) (((uchar*) src) + sbpl); + } + } +} +#else +void qt_blend_rgb16_on_rgb16_mips_dsp(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha) +{ + if (const_alpha == 256) { + if (w < 256) { + const quint16 *src = (const quint16*) srcPixels; + quint16 *dst = (quint16*) destPixels; + for (int y = 0; y < h; ++y) { + qt_blend_rgb16_on_rgb16_const_alpha_256_mips_dsp_asm(dst, src, w); + dst = (quint16*) (((uchar*) dst) + dbpl); + src = (quint16*) (((uchar*) src) + sbpl); + } + } + else { + int length = w << 1; + while (h--) { + memcpy(destPixels, srcPixels, length); + destPixels += dbpl; + srcPixels += sbpl; + } + } + } + else if (const_alpha != 0) { + const quint16 *src = (const quint16*) srcPixels; + quint16 *dst = (quint16*) destPixels; + for (int y = 0; y < h; ++y) { + qt_blend_rgb16_on_rgb16_mips_dsp_asm(dst, src, w, const_alpha); + dst = (quint16*) (((uchar*) dst) + dbpl); + src = (quint16*) (((uchar*) src) + sbpl); + } + } +} +#endif + void comp_func_Source_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha) { if (const_alpha == 255) { @@ -422,5 +494,28 @@ void QT_FASTCALL comp_func_SourceOut_mips_dsp(uint *dest, const uint *src, int l comp_func_SourceOut_dsp_asm_x2(dest, src, length, const_alpha); } +const uint * QT_FASTCALL qt_fetchUntransformed_888_mips_dsp (uint *buffer, const Operator *, const QSpanData *data, + int y, int x, int length) +{ + uchar *line = (uchar *)data->texture.scanLine(y) + x; + fetchUntransformed_888_asm_mips_dsp(buffer, line, length); + return buffer; +} + +const uint * QT_FASTCALL qt_fetchUntransformed_444_mips_dsp (uint *buffer, const Operator *, const QSpanData *data, + int y, int x, int length) +{ + uchar *line = (uchar *)data->texture.scanLine(y) + x; + fetchUntransformed_444_asm_mips_dsp(buffer, line, length); + return buffer; +} + +const uint * QT_FASTCALL qt_fetchUntransformed_argb8565_premultiplied_mips_dsp (uint *buffer, const Operator *, const QSpanData *data, + int y, int x, int length) +{ + uchar *line = (uchar *)data->texture.scanLine(y) + x; + fetchUntransformed_argb8565_premultiplied_asm_mips_dsp(buffer, line, length); + return buffer; +} QT_END_NAMESPACE |