Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Unified Diff: src/gpu/GrBitmapTextContext.cpp

Issue 793013003: Remove the low hanging fruit with coord change matrices (Closed) Base URL: https://skia.googlesource.com/skia.git@more-ccm-cleanup
Patch Set: comment cleanup Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698