summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2010-07-20 12:48:38 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2010-07-20 16:35:40 (GMT)
commit5a8a64821da7dae1ff5351b898899a5974c6d569 (patch)
tree94cc3c9dfb64adb912c5fd30df18151e0774ccc8 /src/gui/painting
parent42267701edd266463c90cec82d45022446a2606a (diff)
downloadQt-5a8a64821da7dae1ff5351b898899a5974c6d569.zip
Qt-5a8a64821da7dae1ff5351b898899a5974c6d569.tar.gz
Qt-5a8a64821da7dae1ff5351b898899a5974c6d569.tar.bz2
Remove the masking when computing qAlpha()
After a bit shift of 24, only the alpha value should remain, so it is not necessary to mask the result. The documentation state QRgb works on a ARGB quadruplet, so the upper bits can be assumed to be zero in the cases when QRgb is 64 bits. This saves some time because qAlpha() is used for each pixel in the generic blend functions. Reviewed-by: Andreas Kling Reviewed-by: Kim
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qrgb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qrgb.h b/src/gui/painting/qrgb.h
index 8e635a8..ea5f353 100644
--- a/src/gui/painting/qrgb.h
+++ b/src/gui/painting/qrgb.h
@@ -64,7 +64,7 @@ Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb) // get blue part of RGB
{ return (rgb & 0xff); }
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb) // get alpha part of RGBA
-{ return ((rgb >> 24) & 0xff); }
+{ return rgb >> 24; }
Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)// set RGB value
{ return (0xffu << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }