Bug 1591432 - avoid creating paths for color fonts on macOS. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D52100

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Lee Salzman 2019-11-06 21:50:24 +00:00
parent 3478d1443a
commit ba7cbe4ae5

View File

@ -1280,7 +1280,9 @@ void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
// it should be empty. So, if we see a zero-advance, we check if it has an
// empty path or not, and if so, we jam the bounds to 0. Hopefully a zero-advance
// is rare, so we won't incur a big performance cost for this extra check.
if (0 == cgAdvance.width && 0 == cgAdvance.height) {
// Avoid trying to create a path from a color font due to crashing on 10.9.
if (0 == cgAdvance.width && 0 == cgAdvance.height &&
SkMask::kARGB32_Format != glyph->fMaskFormat) {
SkUniqueCFRef<CGPathRef> path(CTFontCreatePathForGlyph(fCTFont.get(), cgGlyph,nullptr));
if (!path || CGPathIsEmpty(path.get())) {
return;