Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8237833: Check glyph size before adding to glyph texture cache
Reviewed-by: kcr
  • Loading branch information
prrace committed Jan 31, 2020
1 parent 1213ea7 commit d05e8fc
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -291,7 +291,12 @@ private GlyphData getCachedGlyph(int glyphCode, int subPixel) {
}
// If add fails,clear up the cache. Try add again.
clearAll();
packer.add(rect);
if (!packer.add(rect)) {
if (PrismSettings.verbose) {
System.out.println(rect + " won't fit in GlyphCache");
}
return null;
}
}

// We always pass skipFlush=true to backingStore.update()
Expand Down Expand Up @@ -320,7 +325,9 @@ private GlyphData getCachedGlyph(int glyphCode, int subPixel) {
0, 0, emw, emh, stride,
skipFlush);
} catch (Exception e) {
e.printStackTrace();
if (PrismSettings.verbose) {
e.printStackTrace();
}
return null;
}
// Upload the glyph
Expand Down

0 comments on commit d05e8fc

Please sign in to comment.