diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-04-28 08:03:58 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-04-29 09:57:28 (GMT) |
commit | ff57b90c0419a7058cf44413ab19d5aac7fb5f50 (patch) | |
tree | d56e5d39c32e29adf7318f9ec7666d5166db4433 /src/gui/painting/qblendfunctions.cpp | |
parent | 75868b9e64d541ec0ffcfa04fdcc5e36354f47e4 (diff) | |
download | Qt-ff57b90c0419a7058cf44413ab19d5aac7fb5f50.zip Qt-ff57b90c0419a7058cf44413ab19d5aac7fb5f50.tar.gz Qt-ff57b90c0419a7058cf44413ab19d5aac7fb5f50.tar.bz2 |
Improved performance for pixmaps containing 0-alpha pixels.
Areas of 0-alpha are quite common in ARGB images/pixmaps, so special
case them in the argb32 on argb32 image blend function.
Reviewed-by: Trond
Diffstat (limited to 'src/gui/painting/qblendfunctions.cpp')
-rw-r--r-- | src/gui/painting/qblendfunctions.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp index dd7b016..16dd617 100644 --- a/src/gui/painting/qblendfunctions.cpp +++ b/src/gui/painting/qblendfunctions.cpp @@ -518,11 +518,10 @@ static void qt_blend_argb32_on_argb32(uchar *destPixels, int dbpl, for (int y=0; y<h; ++y) { for (int x=0; x<w; ++x) { uint s = src[x]; - if ((s & 0xff000000) == 0xff000000) + if (s >= 0xff000000) dst[x] = s; - else { + else if (s != 0) dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); - } } dst = (quint32 *)(((uchar *) dst) + dbpl); src = (const quint32 *)(((const uchar *) src) + sbpl); |