From c2878e23d405e7ae77f6110602ad75ce1f6b941c Mon Sep 17 00:00:00 2001 From: bsalomon Date: Tue, 17 May 2016 13:18:03 -0700 Subject: 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 --- src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp') 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]; -- cgit v1.2.3