Index: src/gpu/GrBitmapTextContext.cpp |
diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp |
index 921c198eebd2e9b2c6e0ff1b4a30a3e7daa002cb..25f7942ea0246ddb66ce35924f4e72c7754ba9c3 100755 |
--- a/src/gpu/GrBitmapTextContext.cpp |
+++ b/src/gpu/GrBitmapTextContext.cpp |
@@ -430,6 +430,8 @@ void GrBitmapTextContext::appendGlyph(GrGlyph::PackedID packed, |
} |
} |
+ // If the font is too large, we fall back to paths in SkGpuDevice. However, its possible for |
bsalomon
2014/12/18 21:03:04
Not just possible for corrupted fonts...
|
+ // a corrupted font to have a super large glyph. We test for this below and fall back to paths. |
if (NULL == glyph->fPlot && !uploadGlyph(glyph, scaler)) { |
if (NULL == glyph->fPath) { |
SkPath* path = SkNEW(SkPath); |
@@ -447,10 +449,10 @@ void GrBitmapTextContext::appendGlyph(GrGlyph::PackedID packed, |
SkMatrix translate; |
translate.setTranslate(SkFixedToScalar(vx - SkIntToFixed(glyph->fBounds.fLeft)), |
SkFixedToScalar(vy - SkIntToFixed(glyph->fBounds.fTop))); |
- GrPaint tmpPaint(fPaint); |
- tmpPaint.localCoordChange(translate); |
+ SkPath tmpPath(*glyph->fPath); |
+ tmpPath.transform(translate); |
GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle); |
- fContext->drawPath(tmpPaint, translate, *glyph->fPath, strokeInfo); |
+ fContext->drawPath(fPaint, SkMatrix::I(), tmpPath, strokeInfo); |
// remove this glyph from the vertices we need to allocate |
fTotalVertexCount -= kVerticesPerGlyph; |