summaryrefslogtreecommitdiff
path: root/debian/patches/0223-fix-qpixmap-hasalpha.diff
blob: 5e7a0583a60c9c1ba5dec73a62d1bc8988f9ae5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
qt-bugs@ issue : N206173
Trolltech task ID : 206174
bugs.kde.org number : none
applied: no
author: Fredrik Höglund <fredrik@kde.org>

Calling data->mask() in a pixmap that has an alpha channel causes
the mask to be generated from the alpha channel.  This is a very
expensive operation, and completely unecessary in this case since
the generated bitmap is immediately discarded.

Fix the issue by reversing the order of the tests in the return
statement, so the function returns true if the pixmap has an alpha
channel, without generating the mask.

--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -1661,7 +1661,7 @@
 */
 bool QPixmap::hasAlpha() const
 {
-    return (!data->mask().isNull() || data->hasAlphaChannel());
+    return (data->hasAlphaChannel() || !data->mask().isNull());
 }
 
 /*!