Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: src/gpu/GrTextStrike.cpp

Issue 585853003: Don't try to add large glyphs to the font atlas. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrTextStrike.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/gpu/GrTextStrike.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698