Move appending of large glyphs into GrAtlasTextBlob
BUG=skia:
Review URL: https://codereview.chromium.org/1517563002
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index 615f709..153d0fe 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -889,19 +889,14 @@
int width = glyph->fBounds.width();
int height = glyph->fBounds.height();
- // If the glyph is too large we fall back to paths
- if (glyph->fTooLargeForAtlas) {
- this->appendGlyphPath(blob, glyph, scaler, skGlyph, SkIntToScalar(vx), SkIntToScalar(vy));
- return;
- }
-
SkRect r;
r.fLeft = SkIntToScalar(x);
r.fTop = SkIntToScalar(y);
r.fRight = r.fLeft + SkIntToScalar(width);
r.fBottom = r.fTop + SkIntToScalar(height);
- blob->appendGlyph(runIndex, r, color, fCurrStrike, glyph);
+ blob->appendGlyph(runIndex, r, color, fCurrStrike, glyph, scaler, skGlyph,
+ SkIntToScalar(vx), SkIntToScalar(vy), 1.0f, false);
}
bool GrAtlasTextContext::dfAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
@@ -941,32 +936,11 @@
sy += dy;
SkRect glyphRect = SkRect::MakeXYWH(sx, sy, width, height);
- // TODO combine with the above
- // If the glyph is too large we fall back to paths
- if (glyph->fTooLargeForAtlas) {
- this->appendGlyphPath(blob, glyph, scaler, skGlyph, sx - dx, sy - dy, scale, true);
- return true;
- }
-
- blob->appendGlyph(runIndex, glyphRect, color, fCurrStrike, glyph);
+ blob->appendGlyph(runIndex, glyphRect, color, fCurrStrike, glyph, scaler, skGlyph,
+ sx - dx, sy - dy, scale, true);
return true;
}
-inline void GrAtlasTextContext::appendGlyphPath(GrAtlasTextBlob* blob, GrGlyph* glyph,
- GrFontScaler* scaler, const SkGlyph& skGlyph,
- SkScalar x, SkScalar y, SkScalar scale,
- bool applyVM) {
- if (nullptr == glyph->fPath) {
- const SkPath* glyphPath = scaler->getGlyphPath(skGlyph);
- if (!glyphPath) {
- return;
- }
-
- glyph->fPath = new SkPath(*glyphPath);
- }
- blob->fBigGlyphs.push_back(GrAtlasTextBlob::BigGlyph(*glyph->fPath, x, y, scale, applyVM));
-}
-
void GrAtlasTextContext::flushRunAsPaths(GrDrawContext* dc,
const SkTextBlobRunIterator& it,
const GrClip& clip, const SkPaint& skPaint,