Fix error with transforming custom/large glyphs
BUG=661244
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4738
Change-Id: I9f14ca830f9de92000e751a4a99ff1eb9b01db33
Reviewed-on: https://skia-review.googlesource.com/4866
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp
index 9c6fdf3..a160cb5 100644
--- a/src/gpu/text/GrAtlasTextBlob.cpp
+++ b/src/gpu/text/GrAtlasTextBlob.cpp
@@ -74,11 +74,11 @@
GrBatchTextStrike* strike,
GrGlyph* glyph,
SkGlyphCache* cache, const SkGlyph& skGlyph,
- SkScalar x, SkScalar y, SkScalar scale, bool applyVM) {
+ SkScalar x, SkScalar y, SkScalar scale, bool treatAsBMP) {
// If the glyph is too large we fall back to paths
if (glyph->fTooLargeForAtlas) {
- this->appendLargeGlyph(glyph, cache, skGlyph, x, y, scale, applyVM);
+ this->appendLargeGlyph(glyph, cache, skGlyph, x, y, scale, treatAsBMP);
return;
}
@@ -157,7 +157,7 @@
}
void GrAtlasTextBlob::appendLargeGlyph(GrGlyph* glyph, SkGlyphCache* cache, const SkGlyph& skGlyph,
- SkScalar x, SkScalar y, SkScalar scale, bool applyVM) {
+ SkScalar x, SkScalar y, SkScalar scale, bool treatAsBMP) {
if (nullptr == glyph->fPath) {
const SkPath* glyphPath = cache->findPath(skGlyph);
if (!glyphPath) {
@@ -166,7 +166,7 @@
glyph->fPath = new SkPath(*glyphPath);
}
- fBigGlyphs.push_back(GrAtlasTextBlob::BigGlyph(*glyph->fPath, x, y, scale, applyVM));
+ fBigGlyphs.push_back(GrAtlasTextBlob::BigGlyph(*glyph->fPath, x, y, scale, treatAsBMP));
}
bool GrAtlasTextBlob::mustRegenerate(const SkPaint& paint,
@@ -359,12 +359,12 @@
SkScalar transX, transY;
for (int i = 0; i < fBigGlyphs.count(); i++) {
GrAtlasTextBlob::BigGlyph& bigGlyph = fBigGlyphs[i];
- calculate_translation(bigGlyph.fApplyVM, viewMatrix, x, y,
+ calculate_translation(bigGlyph.fTreatAsBMP, viewMatrix, x, y,
fInitialViewMatrix, fInitialX, fInitialY, &transX, &transY);
SkMatrix ctm;
ctm.setScale(bigGlyph.fScale, bigGlyph.fScale);
ctm.postTranslate(bigGlyph.fX + transX, bigGlyph.fY + transY);
- if (bigGlyph.fApplyVM) {
+ if (!bigGlyph.fTreatAsBMP) {
ctm.postConcat(viewMatrix);
}