diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-02-23 13:16:17 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-02-24 22:11:39 +0000 |
commit | b725b5fd9158d95f3693a06425924271ee4b4239 (patch) | |
tree | 26df3da6269f1cfd82d2329867b453342350b37c | |
parent | 704ee03ee308086a33c29197af50f06c719ab6eb (diff) | |
download | qtsvg-b725b5fd9158d95f3693a06425924271ee4b4239.tar.gz |
Stop using PREMUL and INV_PREMUL macrosv5.5.0-alpha1
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 <gunnar@sletta.org>
-rw-r--r-- | src/svg/qsvggenerator.cpp | 6 |
1 files 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))); } } |