summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qrgba64_p.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-12-04 15:05:04 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-09-22 17:15:26 +0200
commitd0d18b06458edd3b6b0712ea71c787404bbaa7e1 (patch)
tree3918a8c40b49c69bef47fcd01598e854bfd77dfc /src/gui/painting/qrgba64_p.h
parentbc35941dbbf6cbd09805a2217ecb062c565855ad (diff)
Handle transparent pen color in fast text path
Switches the text blending to be SourceOver as that is much more common than Source, and means we can now handle semi-transparent text colors there. Task-number: QTBUG-72165 Change-Id: I7b3aedb22412e6fb6f60197596b37f26c6008784 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/painting/qrgba64_p.h')
-rw-r--r--src/gui/painting/qrgba64_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/painting/qrgba64_p.h b/src/gui/painting/qrgba64_p.h
index ca879de27c..d145dbfbea 100644
--- a/src/gui/painting/qrgba64_p.h
+++ b/src/gui/painting/qrgba64_p.h
@@ -284,6 +284,8 @@ static Q_ALWAYS_INLINE void blend_pixel(QRgba64 &dst, QRgba64 src)
static Q_ALWAYS_INLINE void blend_pixel(QRgba64 &dst, QRgba64 src, const int const_alpha)
{
+ if (const_alpha == 255)
+ return blend_pixel(dst, src);
if (!src.isTransparent()) {
src = multiplyAlpha255(src, const_alpha);
dst = src + multiplyAlpha65535(dst, 65535 - src.alpha());