DFText: fix placement of glyphs when we fall back to paths

Rendering a glyph with a path wants to place it at the (sx, sy) we get
as input to the method, but we add (dx, dy) for the clipRect check.
Hence, we need to subtract that out before we render the path.

Review URL: https://codereview.chromium.org/699283003
This commit is contained in:
jvanverth 2014-11-04 13:32:53 -08:00 committed by Commit bot
parent 7b8646669f
commit 0e66aaa503

View File

@ -548,7 +548,7 @@ bool GrDistanceFieldTextContext::appendGlyph(GrGlyph::PackedID packed,
GrContext::AutoMatrix am;
SkMatrix ctm;
ctm.setScale(fTextRatio, fTextRatio);
ctm.postTranslate(sx, sy);
ctm.postTranslate(sx - dx, sy - dy);
GrPaint tmpPaint(fPaint);
am.setPreConcat(fContext, ctm, &tmpPaint);
GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle);