Index: src/gpu/GrTextStrike.cpp |
diff --git a/src/gpu/GrTextStrike.cpp b/src/gpu/GrTextStrike.cpp |
index 24fa7075486cbd00db9a39d02e101aeb248ca2dc..fa97f73f05c603911b685ce8068218f36ef3b2b0 100644 |
--- a/src/gpu/GrTextStrike.cpp |
+++ b/src/gpu/GrTextStrike.cpp |
@@ -289,6 +289,19 @@ void GrTextStrike::removePlot(const GrPlot* plot) { |
GrAtlas::RemovePlot(&fPlotUsage, plot); |
} |
+bool GrTextStrike::glyphTooLargeForAtlas(GrGlyph* glyph) { |
+ int width = glyph->fBounds.width(); |
+ int height = glyph->fBounds.height(); |
+ int pad = fUseDistanceField ? 2 * SK_DistanceFieldPad : 0; |
+ if (width + pad > GR_PLOT_WIDTH) { |
+ return true; |
+ } |
+ if (height + pad > GR_PLOT_HEIGHT) { |
+ return true; |
+ } |
+ |
+ return false; |
+} |
bool GrTextStrike::addGlyphToAtlas(GrGlyph* glyph, GrFontScaler* scaler) { |
#if 0 // testing hack to force us to flush our cache often |