Index: src/gpu/GrAtlasTextContext.cpp |
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp |
index d9807abafd9dcff92faebdd3a5714db47f95c0d4..fbfb17c02a57f3c019e060d6f18977a2918cef54 100644 |
--- a/src/gpu/GrAtlasTextContext.cpp |
+++ b/src/gpu/GrAtlasTextContext.cpp |
@@ -815,6 +815,7 @@ public: |
GrBatchTextStrike* strike = NULL; |
bool brokenRun = false; |
if (regenerateTextureCoords) { |
+ info.fBulkTokenReffer.reset(); |
desc = run.fDescriptor.getDesc(); |
cache = SkGlyphCache::DetachCache(run.fTypeface, desc); |
scaler = GrTextContext::GetGrFontScaler(cache); |
@@ -841,7 +842,8 @@ public: |
SkASSERT(success); |
} |
- fFontCache->setGlyphRefToken(glyph, batchTarget->currentToken()); |
+ fFontCache->setGlyphRefToken(&info.fBulkTokenReffer, |
+ glyph, batchTarget->currentToken()); |
// Texture coords are the last vertex attribute so we get a pointer to the |
// first one and then map with stride in regenerateTextureCoords |
@@ -870,6 +872,9 @@ public: |
} |
} else { |
instancesToFlush += glyphCount; |
+ |
+ // Ref all of the plots in the atlas to prevent eviction |
+ fFontCache->setRefTokenBulk(info.fBulkTokenReffer, fMaskFormat); |
} |
// now copy all vertices |