Index: src/gpu/GrAtlasTextContext.cpp |
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp |
index 6f8d1196368ca992242abcb993b15ba4003ee3df..f5976392cc64107fae2dbfa41cbaddb67e77c75d 100644 |
--- a/src/gpu/GrAtlasTextContext.cpp |
+++ b/src/gpu/GrAtlasTextContext.cpp |
@@ -1221,6 +1221,7 @@ |
Run& run = blob->fRuns[runIndex]; |
if (!fCurrStrike) { |
fCurrStrike = fContext->getBatchFontCache()->getStrike(scaler); |
+ run.fStrike.reset(SkRef(fCurrStrike)); |
} |
GrGlyph::PackedID id = GrGlyph::Pack(skGlyph.getGlyphID(), |
@@ -1262,9 +1263,6 @@ |
PerSubRunInfo* subRun = &run.fSubRunInfo.back(); |
if (run.fInitialized && subRun->fMaskFormat != format) { |
subRun = &run.push_back(); |
- subRun->fStrike.reset(SkRef(fCurrStrike)); |
- } else if (!run.fInitialized) { |
- subRun->fStrike.reset(SkRef(fCurrStrike)); |
} |
run.fInitialized = true; |
@@ -1290,6 +1288,7 @@ |
Run& run = blob->fRuns[runIndex]; |
if (!fCurrStrike) { |
fCurrStrike = fContext->getBatchFontCache()->getStrike(scaler); |
+ run.fStrike.reset(SkRef(fCurrStrike)); |
} |
GrGlyph::PackedID id = GrGlyph::Pack(skGlyph.getGlyphID(), |
@@ -1340,10 +1339,6 @@ |
} |
PerSubRunInfo* subRun = &run.fSubRunInfo.back(); |
- if (!run.fInitialized) { |
- subRun->fStrike.reset(SkRef(fCurrStrike)); |
- } |
- run.fInitialized = true; |
SkASSERT(glyph->fMaskFormat == kA8_GrMaskFormat); |
subRun->fMaskFormat = kA8_GrMaskFormat; |
@@ -1608,7 +1603,7 @@ |
uint64_t currentAtlasGen = fFontCache->atlasGeneration(maskFormat); |
bool regenerateTextureCoords = info.fAtlasGeneration != currentAtlasGen || |
- info.fStrike->isAbandoned(); |
+ run.fStrike->isAbandoned(); |
bool regenerateColors; |
if (usesDistanceFields) { |
regenerateColors = !isLCD && run.fColor != args.fColor; |
@@ -1656,15 +1651,15 @@ |
desc = newDesc; |
cache = SkGlyphCache::DetachCache(run.fTypeface, desc); |
scaler = GrTextContext::GetGrFontScaler(cache); |
- strike = info.fStrike; |
+ strike = run.fStrike; |
typeface = run.fTypeface; |
} |
- if (info.fStrike->isAbandoned()) { |
+ if (run.fStrike->isAbandoned()) { |
regenerateGlyphs = true; |
strike = fFontCache->getStrike(scaler); |
} else { |
- strike = info.fStrike; |
+ strike = run.fStrike; |
} |
} |
@@ -1737,7 +1732,7 @@ |
run.fColor = args.fColor; |
if (regenerateTextureCoords) { |
if (regenerateGlyphs) { |
- info.fStrike.reset(SkRef(strike)); |
+ run.fStrike.reset(SkRef(strike)); |
} |
info.fAtlasGeneration = brokenRun ? GrBatchAtlas::kInvalidAtlasGeneration : |
fFontCache->atlasGeneration(maskFormat); |