aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/fontmgr.cpp
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2017-07-24 11:04:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-24 15:57:30 +0000
commit2112df028caf651bed28ee3203625b9a57d48333 (patch)
tree2f156fdb94c2e5bbd14226b7a64a38ddf8c1a59c /gm/fontmgr.cpp
parentfd51b2ba45199516abe2a968f5ac5b278d35c6e6 (diff)
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 <mtklein@chromium.org> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'gm/fontmgr.cpp')
-rw-r--r--gm/fontmgr.cpp4
1 files changed, 3 insertions, 1 deletions
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<SkFontStyleSet> set(fm->createStyleSet(i));
for (int j = 0; j < set->count() && j < 3; ++j) {
paint.setTypeface(sk_sp<SkTypeface>(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]);