Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1056)

Unified Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1266253002: Revert of Move strike to subrun in GrAtlasTextContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAtlasTextBlob.h ('k') | src/gpu/GrBatchAtlas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/gpu/GrAtlasTextBlob.h ('k') | src/gpu/GrBatchAtlas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698