From 72c242c7a21d28d652cea082fa08efc7b419bc20 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 4 Mar 2024 20:50:52 +0100 Subject: [PATCH] CMYK: remove unnecessary qPremultiply calls Although the output of these functions is premultiplied ARGB, we know the alpha is always going to be full (1.0) because the source is CMYK 32 bit (without alpha). We can therefore avoid calling qPremultiply. This work has been kindly sponsored by the QGIS project (https://qgis.org/). Change-Id: I129b601f5c93a1c444ab06c3325f946d2bcc6efc Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qpixellayout.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/painting/qpixellayout.cpp b/src/gui/painting/qpixellayout.cpp index e94fbbff15..1f34650e57 100644 --- a/src/gui/painting/qpixellayout.cpp +++ b/src/gui/painting/qpixellayout.cpp @@ -1676,7 +1676,7 @@ static const QRgba64 *QT_FASTCALL convertCMYK32ToToRGBA64PM(QRgba64 *buffer, con const QList *, QDitherInfo *) { for (int i = 0; i < count; ++i) - buffer[i] = qPremultiply(QCmyk32::fromCmyk32(src[i]).toColor().rgba64()); + buffer[i] = QCmyk32::fromCmyk32(src[i]).toColor().rgba64(); return buffer; } @@ -1685,7 +1685,7 @@ static const uint *QT_FASTCALL fetchCMYK32ToARGB32PM(uint *buffer, const uchar * { const uint *s = reinterpret_cast(src) + index; for (int i = 0; i < count; ++i) - buffer[i] = qPremultiply(QCmyk32::fromCmyk32(s[i]).toColor().rgba()); + buffer[i] = QCmyk32::fromCmyk32(s[i]).toColor().rgba(); return buffer; } @@ -1694,7 +1694,7 @@ static const QRgba64 *QT_FASTCALL fetchCMYK32ToRGBA64PM(QRgba64 *buffer, const u { const uint *s = reinterpret_cast(src) + index; for (int i = 0; i < count; ++i) - buffer[i] = qPremultiply(QCmyk32::fromCmyk32(s[i]).toColor().rgba64()); + buffer[i] = QCmyk32::fromCmyk32(s[i]).toColor().rgba64(); return buffer; }