summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-12-21 13:22:27 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2010-01-04 12:28:09 (GMT)
commit4cfb341b0cc38f32fb6fba134bfeb96197337867 (patch)
tree164e5e22008f6d086d03567a66a460c7283a5261 /src/gui/painting
parentd6d9c2ab41a2ecc6f038e6cb0f800d080f052147 (diff)
downloadQt-4cfb341b0cc38f32fb6fba134bfeb96197337867.zip
Qt-4cfb341b0cc38f32fb6fba134bfeb96197337867.tar.gz
Qt-4cfb341b0cc38f32fb6fba134bfeb96197337867.tar.bz2
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/gui/painting')
-rw-r--r--src/gui/painting/qdrawhelper.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 84cf5cc..9bb4486 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) {