summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qrgba64.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qrgba64.h')
-rw-r--r--src/gui/painting/qrgba64.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/painting/qrgba64.h b/src/gui/painting/qrgba64.h
index 2c8f8fa8c4..0e5344cacb 100644
--- a/src/gui/painting/qrgba64.h
+++ b/src/gui/painting/qrgba64.h
@@ -127,6 +127,10 @@ public:
Q_DECL_RELAXED_CONSTEXPR QRgba64 premultiplied() const
{
+ if (isOpaque())
+ return *this;
+ if (isTransparent())
+ return QRgba64::fromRgba64(0);
const quint32 a = alpha();
const quint16 r = div_65535(red() * a);
const quint16 g = div_65535(green() * a);