aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@google.com>2015-07-31 14:07:50 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-31 14:07:51 -0700
commitda9ccf175430fd9337355334503aedb464676078 (patch)
tree452e38e836f64a70979b5921b2eec92018980c50
parentbdb34d0345748f424e3c787ad9bbef04134c7e3b (diff)
Revert of Move strike to subrun in GrAtlasTextContext (patchset #3 id:40001 of https://codereview.chromium.org/1257253005/)
Reason for revert: breaking bots Original issue's description: > Move strike to subrun in GrAtlasTextContext > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/77d89f7dd243a17452d3a5f16a98622993e6bdd9 TBR=bsalomon@google.com,robertphillips@google.com,jvanverth@google.com,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1266253002
-rw-r--r--src/gpu/GrAtlasTextBlob.h15
-rw-r--r--src/gpu/GrAtlasTextContext.cpp19
-rw-r--r--src/gpu/GrBatchAtlas.h5
3 files changed, 8 insertions, 31 deletions
diff --git a/src/gpu/GrAtlasTextBlob.h b/src/gpu/GrAtlasTextBlob.h
index 390f1bbc51..502177d0d2 100644
--- a/src/gpu/GrAtlasTextBlob.h
+++ b/src/gpu/GrAtlasTextBlob.h
@@ -78,19 +78,6 @@ struct GrAtlasTextBlob : public SkRefCnt {
, fGlyphStartIndex(0)
, fGlyphEndIndex(0)
, fDrawAsDistanceFields(false) {}
- SubRunInfo(const SubRunInfo& that)
- : fBulkUseToken(that.fBulkUseToken)
- , fStrike(SkRef(that.fStrike.get()))
- , fAtlasGeneration(that.fAtlasGeneration)
- , fVertexStartIndex(that.fVertexStartIndex)
- , fVertexEndIndex(that.fVertexEndIndex)
- , fGlyphStartIndex(that.fGlyphStartIndex)
- , fGlyphEndIndex(that.fGlyphEndIndex)
- , fTextRatio(that.fTextRatio)
- , fMaskFormat(that.fMaskFormat)
- , fDrawAsDistanceFields(that.fDrawAsDistanceFields)
- , fUseLCDText(that.fUseLCDText) {
- }
// Distance field text cannot draw coloremoji, and so has to fall back. However,
// though the distance field text and the coloremoji may share the same run, they
// will have different descriptors. If fOverrideDescriptor is non-NULL, then it
@@ -99,7 +86,6 @@ struct GrAtlasTextBlob : public SkRefCnt {
// significantly, and then the subrun could just have a refed pointer to the
// correct descriptor.
GrBatchAtlas::BulkUseTokenUpdater fBulkUseToken;
- SkAutoTUnref<GrBatchTextStrike> fStrike;
uint64_t fAtlasGeneration;
size_t fVertexStartIndex;
size_t fVertexEndIndex;
@@ -124,6 +110,7 @@ struct GrAtlasTextBlob : public SkRefCnt {
return newSubRun;
}
static const int kMinSubRuns = 1;
+ SkAutoTUnref<GrBatchTextStrike> fStrike;
SkAutoTUnref<SkTypeface> fTypeface;
SkRect fVertexBounds;
SkSTArray<kMinSubRuns, SubRunInfo> fSubRunInfo;
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index 6f8d119636..f5976392cc 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -1221,6 +1221,7 @@ void GrAtlasTextContext::bmpAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
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 @@ void GrAtlasTextContext::bmpAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
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 @@ bool GrAtlasTextContext::dfAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
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 @@ bool GrAtlasTextContext::dfAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
}
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 @@ public:
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 @@ public:
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 @@ public:
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);
diff --git a/src/gpu/GrBatchAtlas.h b/src/gpu/GrBatchAtlas.h
index 96d229810b..ce3e40aec4 100644
--- a/src/gpu/GrBatchAtlas.h
+++ b/src/gpu/GrBatchAtlas.h
@@ -67,11 +67,6 @@ public:
class BulkUseTokenUpdater {
public:
BulkUseTokenUpdater() : fPlotAlreadyUpdated(0) {}
- BulkUseTokenUpdater(const BulkUseTokenUpdater& that)
- : fPlotsToUpdate(that.fPlotsToUpdate)
- , fPlotAlreadyUpdated(that.fPlotAlreadyUpdated) {
- }
-
void add(AtlasID id) {
int index = GrBatchAtlas::GetIndexFromID(id);
if (!this->find(index)) {