aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-05-17 13:18:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-17 13:18:03 -0700
commitc2878e23d405e7ae77f6110602ad75ce1f6b941c (patch)
tree60ca9f98e87015f69e83fcde49230418823191cd /src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
parentd3cdbcad65673596ae37e65fec842d8d4d81c5a7 (diff)
Remove GrFontScaler class.
This class is now effectively a set of helpers for interacting with a SkGlyphCache by GrBatchTextStrike. The class is deleted and the code is made into static functions in GrBatchFontCache.cpp BUG=chromium:608566 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1985163002 Review-Url: https://codereview.chromium.org/1985163002
Diffstat (limited to 'src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp')
-rw-r--r--src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp b/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
index 94bfb1b953..e5a8956517 100644
--- a/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
+++ b/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
@@ -143,7 +143,7 @@ void GrAtlasTextBlob::regenInBatch(GrDrawBatch::Target* target,
GrBlobRegenHelper *helper,
Run* run,
Run::SubRunInfo* info, SkGlyphCache** cache,
- SkTypeface** typeface, GrFontScaler** scaler,
+ SkTypeface** typeface,
const SkDescriptor** desc,
int glyphCount, size_t vertexStride,
GrColor color, SkScalar transX,
@@ -166,12 +166,11 @@ void GrAtlasTextBlob::regenInBatch(GrDrawBatch::Target* target,
}
*desc = newDesc;
*cache = SkGlyphCache::DetachCache(run->fTypeface, run->fEffects, *desc);
- *scaler = GrTextUtils::GetGrFontScaler(*cache);
*typeface = run->fTypeface;
}
if (regenGlyphs) {
- strike = fontCache->getStrike(*scaler);
+ strike = fontCache->getStrike(*cache);
} else {
strike = info->strike();
}
@@ -188,20 +187,20 @@ void GrAtlasTextBlob::regenInBatch(GrDrawBatch::Target* target,
// Get the id from the old glyph, and use the new strike to lookup
// the glyph.
GrGlyph::PackedID id = fGlyphs[glyphOffset]->fPackedID;
- fGlyphs[glyphOffset] = strike->getGlyph(id, info->maskFormat(), *scaler);
+ fGlyphs[glyphOffset] = strike->getGlyph(id, info->maskFormat(), *cache);
SkASSERT(id == fGlyphs[glyphOffset]->fPackedID);
}
glyph = fGlyphs[glyphOffset];
SkASSERT(glyph && glyph->fMaskFormat == info->maskFormat());
if (!fontCache->hasGlyph(glyph) &&
- !strike->addGlyphToAtlas(target, glyph, *scaler, info->maskFormat())) {
+ !strike->addGlyphToAtlas(target, glyph, *cache, info->maskFormat())) {
helper->flush();
brokenRun = glyphIdx > 0;
SkDEBUGCODE(bool success =) strike->addGlyphToAtlas(target,
glyph,
- *scaler,
+ *cache,
info->maskFormat());
SkASSERT(success);
}
@@ -248,17 +247,16 @@ enum RegenMask {
kRegenColTexGlyph = kRegenCol | kRegenGlyph,
};
-#define REGEN_ARGS target, fontCache, helper, &run, &info, cache, typeface, scaler, desc, \
+#define REGEN_ARGS target, fontCache, helper, &run, &info, cache, typeface, desc, \
*glyphCount, vertexStride, color, transX, transY
void GrAtlasTextBlob::regenInBatch(GrDrawBatch::Target* target,
GrBatchFontCache* fontCache,
GrBlobRegenHelper *helper,
int runIndex, int subRunIndex, SkGlyphCache** cache,
- SkTypeface** typeface, GrFontScaler** scaler,
- const SkDescriptor** desc, size_t vertexStride,
- const SkMatrix& viewMatrix, SkScalar x, SkScalar y,
- GrColor color,
+ SkTypeface** typeface, const SkDescriptor** desc,
+ size_t vertexStride, const SkMatrix& viewMatrix,
+ SkScalar x, SkScalar y, GrColor color,
void** vertices, size_t* byteCount, int* glyphCount) {
Run& run = fRuns[runIndex];
Run::SubRunInfo& info = run.fSubRunInfo[subRunIndex];