Index: src/gpu/GrTextContext.cpp |
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp |
index 5af0851f4ca017a619a9635bf611dff4b5d40aaf..8f0f1cfde6a0848136be2c75f2b6afd7c53c8b95 100644 |
--- a/src/gpu/GrTextContext.cpp |
+++ b/src/gpu/GrTextContext.cpp |
@@ -153,6 +153,12 @@ void GrTextContext::drawPackedGlyph(GrGlyph::PackedID packed, |
goto HAS_ATLAS; |
} |
+ // try to clear out an unused atlas before we flush |
+ fContext->getFontCache()->freeAtlasExceptFor(fStrike); |
+ if (fStrike->getGlyphAtlas(glyph, scaler)) { |
+ goto HAS_ATLAS; |
+ } |
+ |
// before we purge the cache, we must flush any accumulated draws |
this->flushGlyphs(); |
fContext->flush(); |