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

Unified Diff: src/gpu/GrDistanceFieldTextContext.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/GrBitmapTextContext.cpp ('k') | src/gpu/GrTextStrike.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDistanceFieldTextContext.cpp
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index 18058be17f01924bafe0c363a6448fb0c770267e..313c02ac5132b069a9cb7fed8357ae6976ac0355 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -273,30 +273,32 @@ void GrDistanceFieldTextContext::drawPackedGlyph(GrGlyph::PackedID packed,
}
*/
if (NULL == glyph->fPlot) {
- if (fStrike->addGlyphToAtlas(glyph, scaler)) {
- goto HAS_ATLAS;
- }
+ if (!fStrike->glyphTooLargeForAtlas(glyph)) {
+ if (fStrike->addGlyphToAtlas(glyph, scaler)) {
+ goto HAS_ATLAS;
+ }
- // try to clear out an unused plot before we flush
- if (fContext->getFontCache()->freeUnusedPlot(fStrike) &&
- fStrike->addGlyphToAtlas(glyph, scaler)) {
- goto HAS_ATLAS;
- }
+ // try to clear out an unused plot before we flush
+ if (fContext->getFontCache()->freeUnusedPlot(fStrike) &&
+ fStrike->addGlyphToAtlas(glyph, scaler)) {
+ goto HAS_ATLAS;
+ }
- if (c_DumpFontCache) {
+ if (c_DumpFontCache) {
#ifdef SK_DEVELOPER
- fContext->getFontCache()->dump();
+ fContext->getFontCache()->dump();
#endif
- }
+ }
- // before we purge the cache, we must flush any accumulated draws
- this->flushGlyphs();
- fContext->flush();
+ // before we purge the cache, we must flush any accumulated draws
+ this->flushGlyphs();
+ fContext->flush();
- // we should have an unused plot now
- if (fContext->getFontCache()->freeUnusedPlot(fStrike) &&
- fStrike->addGlyphToAtlas(glyph, scaler)) {
- goto HAS_ATLAS;
+ // we should have an unused plot now
+ if (fContext->getFontCache()->freeUnusedPlot(fStrike) &&
+ fStrike->addGlyphToAtlas(glyph, scaler)) {
+ goto HAS_ATLAS;
+ }
}
if (NULL == glyph->fPath) {
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | src/gpu/GrTextStrike.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698