From 2112df028caf651bed28ee3203625b9a57d48333 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Mon, 24 Jul 2017 11:04:21 -0400 Subject: Don't use fonts with many glyphs in fontmgr_bounds. BUG=skia:6878 Change-Id: I015dff1bafc9433ce155eb1173c42d0eed6ae005 Reviewed-on: https://skia-review.googlesource.com/26202 Reviewed-by: Mike Klein Commit-Queue: Ben Wagner --- gm/fontmgr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gm/fontmgr.cpp') diff --git a/gm/fontmgr.cpp b/gm/fontmgr.cpp index 6bed35426e..8d14e3a66d 100644 --- a/gm/fontmgr.cpp +++ b/gm/fontmgr.cpp @@ -313,7 +313,9 @@ protected: sk_sp set(fm->createStyleSet(i)); for (int j = 0; j < set->count() && j < 3; ++j) { paint.setTypeface(sk_sp(set->createTypeface(j))); - if (paint.getTypeface()) { + // Fonts with lots of glyphs are interesting, but can take a long time to find + // the glyphs which make up the maximum extent. + if (paint.getTypeface() && paint.getTypeface()->countGlyphs() < 1000) { SkRect fontBounds = paint.getFontBounds(); x -= fontBounds.fLeft; show_bounds(canvas, paint, x, y, boundsColors[index & 1]); -- cgit v1.2.3