diff options
author | Benjamin Poulain <benjamin.poulain@nokia.com> | 2010-07-26 15:14:13 (GMT) |
---|---|---|
committer | Benjamin Poulain <benjamin.poulain@nokia.com> | 2010-07-27 09:05:34 (GMT) |
commit | 34beae57ff8248e7666a4ce08a06eeff54e05e7a (patch) | |
tree | 72af98d91ca182b2156cd8b11b607bcf62c2bcc7 /src/gui/painting/qdrawhelper.cpp | |
parent | c3b2f89b85696c01062ddcd9d21a05cebf51b078 (diff) | |
download | Qt-34beae57ff8248e7666a4ce08a06eeff54e05e7a.zip Qt-34beae57ff8248e7666a4ce08a06eeff54e05e7a.tar.gz Qt-34beae57ff8248e7666a4ce08a06eeff54e05e7a.tar.bz2 |
Implement the composition mode "Plus" with SSE2
Implement the composition function for CompositionMode_Plus with SSE2.
The macro MIX() can be replaced by a single instruction add-saturate,
which increase the speed a lot (13 times faster on the blend
benchmark).
Reviewed-by: Olivier Goffart
Reviewed-by: Andreas Kling
Diffstat (limited to 'src/gui/painting/qdrawhelper.cpp')
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index a77c379..4ce2bee 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -1715,11 +1715,6 @@ void QT_FASTCALL comp_func_XOR(uint *dest, const uint *src, int length, uint con } } -static const uint AMASK = 0xff000000; -static const uint RMASK = 0x00ff0000; -static const uint GMASK = 0x0000ff00; -static const uint BMASK = 0x000000ff; - struct QFullCoverage { inline void store(uint *dest, const uint src) const { @@ -7775,6 +7770,7 @@ void qInitDrawhelperAsm() #ifdef QT_HAVE_MMX if (features & MMX) { functionForModeAsm = qt_functionForMode_MMX; + functionForModeSolidAsm = qt_functionForModeSolid_MMX; qDrawHelper[QImage::Format_ARGB32_Premultiplied].blendColor = qt_blend_color_argb_mmx; #ifdef QT_HAVE_3DNOW @@ -7823,8 +7819,10 @@ void qInitDrawhelperAsm() int length, uint const_alpha); extern void QT_FASTCALL comp_func_solid_SourceOver_sse2(uint *destPixels, int length, uint color, uint const_alpha); + extern void QT_FASTCALL comp_func_Plus_sse2(uint *dst, const uint *src, int length, uint const_alpha); functionForModeAsm[0] = comp_func_SourceOver_sse2; + functionForModeAsm[QPainter::CompositionMode_Plus] = comp_func_Plus_sse2; functionForModeSolidAsm[0] = comp_func_solid_SourceOver_sse2; extern void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl, |