diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-12-21 14:22:27 +0100 |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2010-01-04 13:28:09 +0100 |
commit | 4cfb341b0cc38f32fb6fba134bfeb96197337867 (patch) | |
tree | 164e5e22008f6d086d03567a66a460c7283a5261 /src | |
parent | d6d9c2ab41a2ecc6f038e6cb0f800d080f052147 (diff) | |
download | qt4-tools-4cfb341b0cc38f32fb6fba134bfeb96197337867.tar.gz |
Slight performance improvement in comp_func_SourceOver.
We should check for the fully opaque and fully transparent special
cases, like we do in the dedicated image blend functions.
Reveiewed-by: Gunnar Sletta
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 84cf5cc05a..9bb4486dc8 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -1364,7 +1364,10 @@ static void QT_FASTCALL comp_func_SourceOver(uint *dest, const uint *src, int le for (int i = 0; i < length; ++i) { PRELOAD_COND2(dest, src) uint s = src[i]; - dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s)); + if (s >= 0xff000000) + dest[i] = s; + else if (s != 0) + dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s)); } } else { for (int i = 0; i < length; ++i) { |