summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qblendfunctions.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-04-17 14:07:04 +0200
committerGunnar Sletta <gunnar@trolltech.com>2009-04-20 10:10:39 +0200
commit2e5080b136dabf70d0ea3bcb39aff0b5f858056d (patch)
treef89f363bee9a68267b43ab1494cfd116b4aa75a7 /src/gui/painting/qblendfunctions.cpp
parentf619d17ff3fbc8f8ff60a1175bc83435f977550c (diff)
Fix ARGB24PM->RGB16 for i386 GCC
There was special code for gcc to run super-fast, but it was buggy and didn't blend properly. Kill this code for the benefit of the normal blend function. The performance on an Intel Quad Core 2 was not too different from the bytemul approach. Task-number: 246009 Reviewed-by: Trond
Diffstat (limited to 'src/gui/painting/qblendfunctions.cpp')
-rw-r--r--src/gui/painting/qblendfunctions.cpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp
index 84a1e4a79a..70cea4d6f9 100644
--- a/src/gui/painting/qblendfunctions.cpp
+++ b/src/gui/painting/qblendfunctions.cpp
@@ -44,19 +44,6 @@
QT_BEGIN_NAMESPACE
-
-// This ifdef is made with the best of intention. GCC fails to
-// optimzie the code properly so the bytemul approach is the fastest
-// it gets. Both on ARM and on MSVC the code is optimized to be better
-// than the bytemul approach... On the other hand... This code is
-// almost never run on i386 so it may be downright silly to have this
-// piece of code here...
-#if defined (Q_CC_GNU) && (defined (QT_ARCH_I386) || defined (QT_ARCH_X86_64))
-# define QT_BLEND_USE_BYTEMUL
-#endif
-
-// #define QT_DEBUG_DRAW
-
static const qreal aliasedCoordinateDelta = 0.5 - 0.015625;
struct SourceOnlyAlpha
@@ -286,7 +273,7 @@ static void qt_blend_rgb16_on_rgb16(uchar *dst, int dbpl,
int const_alpha)
{
#ifdef QT_DEBUG_DRAW
- printf("qt_blend_argb16_on_rgb16: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
+ printf("qt_blend_rgb16_on_rgb16: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
dst, dbpl, src, sbpl, w, h, const_alpha);
#endif
@@ -347,11 +334,6 @@ template <typename T> void qt_blend_argb24_on_rgb16(uchar *destPixels, int dbpl,
if (alpha == 255) {
*dst = spix;
} else if (alpha != 0) {
-#ifdef QT_BLEND_USE_BYTEMUL
- // truncate green channel to avoid overflow
- *dst = (alphaFunc.bytemul(spix) & 0xffdf)
- + (quint16) qrgb565(*dst).byte_mul(qrgb565::ialpha(alpha));
-#else
quint16 dpix = *dst;
quint32 sia = 255 - alpha;
@@ -368,7 +350,6 @@ template <typename T> void qt_blend_argb24_on_rgb16(uchar *destPixels, int dbpl,
quint32 rb = ((siab + (siab>>8) + (0x80 >> 3)) >> 8) & 0x001f;
*dst = alphaFunc.bytemul(spix) + rr + rg + rb;
-#endif
}
++dst;