GPU Font Cache improvements:
- If a strike has multiple atlases, check all for room for a new glyph
- Mark remaining atlases unused after a purge, then check for an unused
atlas before purging (reduces TextContext flushes and ghosting)
- Hide Atlas management a little better inside AtlasMgr
R=robertphillips@google.com, bsalomon@google.com
Author: jvanverth@google.com
Review URL: https://chromiumcodereview.appspot.com/21594005
git-svn-id: http://skia.googlecode.com/svn/trunk@10544 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrTextStrike.h b/src/gpu/GrTextStrike.h
index 25ced6d..e359e26 100644
--- a/src/gpu/GrTextStrike.h
+++ b/src/gpu/GrTextStrike.h
@@ -46,6 +46,9 @@
}
GrAtlas* getAtlas() const { return fAtlas; }
+ // returns true if an atlas was removed
+ bool removeUnusedAtlases();
+
public:
// for LRU
GrTextStrike* fPrev;
@@ -81,6 +84,9 @@
void purgeExceptFor(GrTextStrike*);
+ // remove an unused atlas and its strike (if necessary)
+ void freeAtlasExceptFor(GrTextStrike*);
+
// testing
int countStrikes() const { return fCache.getArray().count(); }
const GrTextStrike* strikeAt(int index) const {