Index: src/gpu/GrAtlasTextBlob.cpp |
diff --git a/src/gpu/GrAtlasTextBlob.cpp b/src/gpu/GrAtlasTextBlob.cpp |
index 1cd25e74de33e1c8d2904aca466c933f55950204..aa50cbf2541eace8425db378fa98dbd3eb88ecd2 100644 |
--- a/src/gpu/GrAtlasTextBlob.cpp |
+++ b/src/gpu/GrAtlasTextBlob.cpp |
@@ -11,7 +11,16 @@ void GrAtlasTextBlob::appendGlyph(int runIndex, |
const SkRect& positions, |
GrColor color, |
GrBatchTextStrike* strike, |
- GrGlyph* glyph) { |
+ GrGlyph* glyph, |
+ GrFontScaler* scaler, const SkGlyph& skGlyph, |
+ SkScalar x, SkScalar y, SkScalar scale, bool applyVM) { |
+ |
+ // If the glyph is too large we fall back to paths |
+ if (glyph->fTooLargeForAtlas) { |
+ this->appendLargeGlyph(glyph, scaler, skGlyph, x, y, scale, applyVM); |
+ return; |
+ } |
+ |
Run& run = fRuns[runIndex]; |
GrMaskFormat format = glyph->fMaskFormat; |
@@ -86,6 +95,19 @@ void GrAtlasTextBlob::appendGlyph(int runIndex, |
subRun->glyphAppended(); |
} |
+void GrAtlasTextBlob::appendLargeGlyph(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); |
+ } |
+ fBigGlyphs.push_back(GrAtlasTextBlob::BigGlyph(*glyph->fPath, x, y, scale, applyVM)); |
+} |
+ |
bool GrAtlasTextBlob::mustRegenerate(SkScalar* outTransX, SkScalar* outTransY, |
const SkPaint& paint, |
GrColor color, const SkMaskFilter::BlurRec& blurRec, |