Change Atlas recycling to track current flush count and recycle if Atlas not used in current flush.
BUG=
R=bsalomon@google.com, robertphillips@google.com
Author: jvanverth@google.com
Review URL: https://chromiumcodereview.appspot.com/23120004
git-svn-id: http://skia.googlecode.com/svn/trunk@10777 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index 8f0f1cf..f4a3df6 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -148,14 +148,15 @@
}
}
+ GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken();
if (NULL == glyph->fAtlas) {
- if (fStrike->getGlyphAtlas(glyph, scaler)) {
+ if (fStrike->getGlyphAtlas(glyph, scaler, drawToken)) {
goto HAS_ATLAS;
}
// try to clear out an unused atlas before we flush
fContext->getFontCache()->freeAtlasExceptFor(fStrike);
- if (fStrike->getGlyphAtlas(glyph, scaler)) {
+ if (fStrike->getGlyphAtlas(glyph, scaler, drawToken)) {
goto HAS_ATLAS;
}
@@ -165,7 +166,8 @@
// try to purge
fContext->getFontCache()->purgeExceptFor(fStrike);
- if (fStrike->getGlyphAtlas(glyph, scaler)) {
+ // need to use new flush count here
+ if (fStrike->getGlyphAtlas(glyph, scaler, drawToken)) {
goto HAS_ATLAS;
}