diff options
author | Benjamin Poulain <benjamin.poulain@nokia.com> | 2010-02-09 15:58:56 (GMT) |
---|---|---|
committer | Benjamin Poulain <benjamin.poulain@nokia.com> | 2010-02-09 18:03:08 (GMT) |
commit | d9354e6e6863bc1f82b9581726c43f3bd76bc44b (patch) | |
tree | 070a165c52ec2d9a9274bd18441a584ecfd73a3c /src/gui | |
parent | 500f28f04a08e37525e3d1deb5cfe6e908c66b15 (diff) | |
download | Qt-d9354e6e6863bc1f82b9581726c43f3bd76bc44b.zip Qt-d9354e6e6863bc1f82b9581726c43f3bd76bc44b.tar.gz Qt-d9354e6e6863bc1f82b9581726c43f3bd76bc44b.tar.bz2 |
Skip the transparent pixels when doing the sourceOver
Blending fully transparent pixels take a non-negligible time
when webkit use transparent layer. We can avoid that be skipping
those pixels since they have no impact on the final result.
Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qdrawhelper_mmx_p.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/painting/qdrawhelper_mmx_p.h b/src/gui/painting/qdrawhelper_mmx_p.h index f8bc480..59b3804 100644 --- a/src/gui/painting/qdrawhelper_mmx_p.h +++ b/src/gui/painting/qdrawhelper_mmx_p.h @@ -240,7 +240,10 @@ static void QT_FASTCALL comp_func_SourceOver(uint *dest, const uint *src, int le C_FF; C_80; C_00; if (const_alpha == 255) { for (int i = 0; i < length; ++i) { - if ((0xff000000 & src[i]) == 0xff000000) { + const uint alphaMaskedSource = 0xff000000 & src[i]; + if (alphaMaskedSource == 0) + continue; + if (alphaMaskedSource == 0xff000000) { dest[i] = src[i]; } else { m64 s = MM::load(src[i]); @@ -251,6 +254,8 @@ static void QT_FASTCALL comp_func_SourceOver(uint *dest, const uint *src, int le } else { m64 ca = MM::load_alpha(const_alpha); for (int i = 0; i < length; ++i) { + if ((0xff000000 & src[i]) == 0) + continue; m64 s = MM::byte_mul(MM::load(src[i]), ca); m64 ia = MM::negate(MM::alpha(s)); dest[i] = MM::store(MM::add(s, MM::byte_mul(MM::load(dest[i]), ia))); |