From b725b5fd9158d95f3693a06425924271ee4b4239 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 23 Feb 2015 13:16:17 +0100 Subject: Stop using PREMUL and INV_PREMUL macros The two macros were replaced with qPremultiply and qUnpremultiply in Qt 5.3, and this is the last place in Qt the old macros are still used. Change-Id: Ic1bd1f37a843ffa76e37adfcbbde39fbfbd9ff2a Reviewed-by: Gunnar Sletta --- src/svg/qsvggenerator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp index 7374d14..6ffab05 100644 --- a/src/svg/qsvggenerator.cpp +++ b/src/svg/qsvggenerator.cpp @@ -257,17 +257,17 @@ public: if (!constantAlpha) { const qreal spacing = qreal(0.02); QGradientStops newStops; - QRgb fromColor = PREMUL(stops.at(0).second.rgba()); + QRgb fromColor = qPremultiply(stops.at(0).second.rgba()); QRgb toColor; for (int i = 0; i + 1 < stops.size(); ++i) { int parts = qCeil((stops.at(i + 1).first - stops.at(i).first) / spacing); newStops.append(stops.at(i)); - toColor = PREMUL(stops.at(i + 1).second.rgba()); + toColor = qPremultiply(stops.at(i + 1).second.rgba()); if (parts > 1) { qreal step = (stops.at(i + 1).first - stops.at(i).first) / parts; for (int j = 1; j < parts; ++j) { - QRgb color = INV_PREMUL(INTERPOLATE_PIXEL_256(fromColor, 256 - 256 * j / parts, toColor, 256 * j / parts)); + QRgb color = qUnpremultiply(INTERPOLATE_PIXEL_256(fromColor, 256 - 256 * j / parts, toColor, 256 * j / parts)); newStops.append(QGradientStop(stops.at(i).first + j * step, QColor::fromRgba(color))); } } -- cgit v1.2.1