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

Unified Diff: src/gpu/GrTextContext.cpp

Issue 21594005: GPU Font Cache improvements: (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove some added spaces Created 7 years, 5 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
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();

Powered by Google App Engine
This is Rietveld 408576698