Fix crash with gamma-corrected text blending disabled

Change-Id: I7e3ca78278bf8bf2dda44711eb57d64aa6f455ce
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2019-09-23 10:33:20 +02:00
parent 895a786827
commit 6db83e2584

View File

@ -5670,7 +5670,8 @@ static inline void alphamapblend_argb32(quint32 *dst, int coverage, QRgba64 srcL
QRgb s = *dst;
blend_pixel(s, src);
// Then gamma-corrected blend with glyph shape
grayBlendPixel(dst, coverage, colorProfile->toLinear64(s), colorProfile);
QRgba64 s64 = colorProfile ? colorProfile->toLinear64(s) : QRgba64::fromArgb32(s);
grayBlendPixel(dst, coverage, s64, colorProfile);
}
}
@ -5711,7 +5712,9 @@ static inline void alphamapblend_generic(int coverage, QRgba64 *dest, int x, con
QRgba64 s = dest[x];
blend_pixel(s, src);
// Then gamma-corrected blend with glyph shape
grayBlendPixel(dest[x], coverage, colorProfile->toLinear(s), colorProfile);
if (colorProfile)
s = colorProfile->toLinear(s);
grayBlendPixel(dest[x], coverage, s, colorProfile);
}
}
@ -6053,7 +6056,8 @@ static inline void alphargbblend_argb32(quint32 *dst, uint coverage, const QRgba
QRgb s = *dst;
blend_pixel(s, src);
// Then gamma-corrected blend with glyph shape
rgbBlendPixel(dst, coverage, colorProfile->toLinear64(s), colorProfile);
QRgba64 s64 = colorProfile ? colorProfile->toLinear64(s) : QRgba64::fromArgb32(s);
rgbBlendPixel(dst, coverage, s64, colorProfile);
}
}
@ -6084,7 +6088,9 @@ static inline void alphargbblend_generic(uint coverage, QRgba64 *dest, int x, co
QRgba64 s = dest[x];
blend_pixel(s, src);
// Then gamma-corrected blend with glyph shape
rgbBlendPixel(dest[x], coverage, colorProfile->toLinear(s), colorProfile);
if (colorProfile)
s = colorProfile->toLinear(s);
rgbBlendPixel(dest[x], coverage, s, colorProfile);
}
}