mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
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:
parent
3478d1443a
commit
ba7cbe4ae5
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user