summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-09-23 10:33:20 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-09-23 10:47:50 +0200
commit6db83e2584a30b1339adba18279fbfd527a10ce7 (patch)
treedc51bdae3d3c90b6a892256f2f1c5dda6dc8249c /src/gui/painting
parent895a786827a0056398c07e3b668f35bd5952849e (diff)
Fix crash with gamma-corrected text blending disabled
Change-Id: I7e3ca78278bf8bf2dda44711eb57d64aa6f455ce Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qdrawhelper.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 3d06a27d8e..e5f752b94e 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -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);
}
}