summaryrefslogtreecommitdiffstats
path: root/kdefx
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-15 19:11:41 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-15 19:11:41 +0000
commit374d939d8af431477ce2601815f0ba121b66871c (patch)
treead878478dcc0bedf51e3cffb2ed611ada422b290 /kdefx
parentf9279733bf71e446933b46f40cbe9c9b9f57b778 (diff)
downloadtdelibs-374d939d8af431477ce2601815f0ba121b66871c.tar.gz
tdelibs-374d939d8af431477ce2601815f0ba121b66871c.zip
Allow kdelibs to function correctly with TQt for Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1220926 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdefx')
-rw-r--r--kdefx/kimageeffect.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/kdefx/kimageeffect.cpp b/kdefx/kimageeffect.cpp
index 80b3c3e68..4864bdfa6 100644
--- a/kdefx/kimageeffect.cpp
+++ b/kdefx/kimageeffect.cpp
@@ -1079,6 +1079,11 @@ TQImage& KImageEffect::blend(const TQColor& clr, TQImage& dst, float opacity)
if (dst.depth() != 32)
dst = dst.convertDepth(32);
+#ifdef USE_QT4
+ if (dst.format() != QImage::Format_ARGB32)
+ dst = dst.convertToFormat(QImage::Format_ARGB32); // This is needed because Qt4 has multiple variants with a 32 bit depth, and the routines below expect one specific variant (ARGB)
+#endif
+
int pixels = dst.width() * dst.height();
#ifdef USE_SSE2_INLINE_ASM
@@ -1329,6 +1334,13 @@ TQImage& KImageEffect::blend(TQImage& src, TQImage& dst, float opacity)
if (src.depth() != 32) src = src.convertDepth(32);
if (dst.depth() != 32) dst = dst.convertDepth(32);
+#ifdef USE_QT4
+ if (src.format() != QImage::Format_ARGB32)
+ src = dst.convertToFormat(QImage::Format_ARGB32); // This is needed because Qt4 has multiple variants with a 32 bit depth, and the routines below expect one specific variant (ARGB)
+ if (dst.format() != QImage::Format_ARGB32)
+ dst = dst.convertToFormat(QImage::Format_ARGB32); // This is needed because Qt4 has multiple variants with a 32 bit depth, and the routines below expect one specific variant (ARGB)
+#endif
+
int pixels = src.width() * src.height();
#ifdef USE_SSE2_INLINE_ASM