diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-12-13 11:08:16 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-04 12:50:01 +0000 |
commit | f95fbca5f363a0b906f64f2eba67acb4525e4c1b (patch) | |
tree | 1519e0b8fa66ac39651c9cdb616024ea4f5cdae0 /src/gui/painting/qrgba64_p.h | |
parent | 8ba8efb8396a2cf3e63860379db30c06173db1f6 (diff) |
Add AVX2 optimized versions of the most basic RGB64 compositions
Speeds up RGB30 and ARGB32-unpremul painting.
Change-Id: I419afdf5c26ceffc0f7557b8f196035056178c9a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/painting/qrgba64_p.h')
-rw-r--r-- | src/gui/painting/qrgba64_p.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/painting/qrgba64_p.h b/src/gui/painting/qrgba64_p.h index 7776a5b08a..adceda2210 100644 --- a/src/gui/painting/qrgba64_p.h +++ b/src/gui/painting/qrgba64_p.h @@ -299,6 +299,21 @@ inline QRgba64 rgbBlend(QRgba64 d, QRgba64 s, uint rgbAlpha) return blend; } +static Q_ALWAYS_INLINE void blend_pixel(QRgba64 &dst, QRgba64 src) +{ + if (src.isOpaque()) + dst = src; + else if (!src.isTransparent()) + dst = src + multiplyAlpha65535(dst, 65535 - src.alpha()); +} + +static Q_ALWAYS_INLINE void blend_pixel(QRgba64 &dst, QRgba64 src, const int const_alpha) +{ + if (!src.isTransparent()) { + src = multiplyAlpha255(src, const_alpha); + dst = src + multiplyAlpha65535(dst, 65535 - src.alpha()); + } +} QT_END_NAMESPACE |