}
}
- GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken();
if (NULL == glyph->fPlot) {
- if (fStrike->getGlyphAtlas(glyph, scaler, drawToken)) {
+ if (fStrike->getGlyphAtlas(glyph, scaler)) {
goto HAS_ATLAS;
}
// try to clear out an unused plot before we flush
fContext->getFontCache()->freePlotExceptFor(fStrike);
- if (fStrike->getGlyphAtlas(glyph, scaler, drawToken)) {
+ if (fStrike->getGlyphAtlas(glyph, scaler)) {
goto HAS_ATLAS;
}
// try to purge
fContext->getFontCache()->purgeExceptFor(fStrike);
// need to use new flush count here
- if (fStrike->getGlyphAtlas(glyph, scaler, drawToken)) {
+ if (fStrike->getGlyphAtlas(glyph, scaler)) {
goto HAS_ATLAS;
}
HAS_ATLAS:
SkASSERT(glyph->fPlot);
+ GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken();
+ glyph->fPlot->setDrawToken(drawToken);
// now promote them to fixed (TODO: Rethink using fixed pt).
width = SkIntToFixed(width);
return fAtlasMgr->removeUnusedPlots(&fAtlas);
}
-bool GrTextStrike::getGlyphAtlas(GrGlyph* glyph, GrFontScaler* scaler,
- GrDrawTarget::DrawToken currentDrawToken) {
+bool GrTextStrike::getGlyphAtlas(GrGlyph* glyph, GrFontScaler* scaler) {
#if 0 // testing hack to force us to flush our cache often
static int gCounter;
if ((++gCounter % 10) == 0) return false;
SkASSERT(glyph);
SkASSERT(scaler);
SkASSERT(fCache.contains(glyph));
- if (glyph->fPlot) {
- glyph->fPlot->setDrawToken(currentDrawToken);
- return true;
- }
+ SkASSERT(NULL == glyph->fPlot);
SkAutoRef ar(scaler);
}
glyph->fPlot = plot;
- plot->setDrawToken(currentDrawToken);
return true;
}
GrMaskFormat getMaskFormat() const { return fMaskFormat; }
inline GrGlyph* getGlyph(GrGlyph::PackedID, GrFontScaler*);
- bool getGlyphAtlas(GrGlyph*, GrFontScaler*, GrDrawTarget::DrawToken currentDrawToken);
+ bool getGlyphAtlas(GrGlyph*, GrFontScaler*);
// testing
int countGlyphs() const { return fCache.getArray().count(); }