| Index: src/gpu/GrBitmapTextContext.cpp
|
| diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp
|
| index 4f43c758992e0936220444307c22efb758752ff5..f2a6d95cb8c7f04c0221862f4743a7a1ac93be9a 100755
|
| --- a/src/gpu/GrBitmapTextContext.cpp
|
| +++ b/src/gpu/GrBitmapTextContext.cpp
|
| @@ -518,13 +518,13 @@ void GrBitmapTextContext::drawPackedGlyph(GrGlyph::PackedID packed,
|
| }
|
|
|
| if (NULL == glyph->fPlot) {
|
| - if (fStrike->getGlyphAtlas(glyph, scaler)) {
|
| + if (fStrike->addGlyphToAtlas(glyph, scaler)) {
|
| goto HAS_ATLAS;
|
| }
|
|
|
| // try to clear out an unused plot before we flush
|
| - fContext->getFontCache()->freePlotExceptFor(fStrike);
|
| - if (fStrike->getGlyphAtlas(glyph, scaler)) {
|
| + if (fContext->getFontCache()->freeUnusedPlot(fStrike) &&
|
| + fStrike->addGlyphToAtlas(glyph, scaler)) {
|
| goto HAS_ATLAS;
|
| }
|
|
|
| @@ -534,14 +534,13 @@ void GrBitmapTextContext::drawPackedGlyph(GrGlyph::PackedID packed,
|
| #endif
|
| }
|
|
|
| - // before we purge the cache, we must flush any accumulated draws
|
| + // flush any accumulated draws to allow us to free up a plot
|
| this->flushGlyphs();
|
| fContext->flush();
|
|
|
| - // try to purge
|
| - fContext->getFontCache()->purgeExceptFor(fStrike);
|
| - // need to use new flush count here
|
| - if (fStrike->getGlyphAtlas(glyph, scaler)) {
|
| + // we should have an unused plot now
|
| + if (fContext->getFontCache()->freeUnusedPlot(fStrike) &&
|
| + fStrike->addGlyphToAtlas(glyph, scaler)) {
|
| goto HAS_ATLAS;
|
| }
|
|
|
|
|