find image whenever we generateGlyph. This should ensure the glyph is fully initialized before we start using the maskformat.
BUG=skia:
Review URL: https://codereview.chromium.org/1270573003
diff --git a/src/gpu/GrFontScaler.cpp b/src/gpu/GrFontScaler.cpp
index a9d5abf..b4ec1be 100644
--- a/src/gpu/GrFontScaler.cpp
+++ b/src/gpu/GrFontScaler.cpp
@@ -64,12 +64,22 @@
}
bool GrFontScaler::getPackedGlyphBounds(const SkGlyph& glyph, SkIRect* bounds) {
+#if 1
+ // crbug:510931
+ // Retrieving the image from the cache can actually change the mask format.
+ fStrike->findImage(glyph);
+#endif
bounds->setXYWH(glyph.fLeft, glyph.fTop, glyph.fWidth, glyph.fHeight);
return true;
}
bool GrFontScaler::getPackedGlyphDFBounds(const SkGlyph& glyph, SkIRect* bounds) {
+#if 1
+ // crbug:510931
+ // Retrieving the image from the cache can actually change the mask format.
+ fStrike->findImage(glyph);
+#endif
bounds->setXYWH(glyph.fLeft, glyph.fTop, glyph.fWidth, glyph.fHeight);
bounds->outset(SK_DistanceFieldPad, SK_DistanceFieldPad);