Index: src/gpu/GrFontCache.cpp |
diff --git a/src/gpu/GrFontCache.cpp b/src/gpu/GrFontCache.cpp |
index 59523664064b5b640c8e73f95369d20c0cc52451..f5c1c22a3da9cd87e2a081ddc1fb4b88a376947b 100644 |
--- a/src/gpu/GrFontCache.cpp |
+++ b/src/gpu/GrFontCache.cpp |
@@ -258,7 +258,7 @@ |
GrGlyph* GrTextStrike::generateGlyph(GrGlyph::PackedID packed, |
GrFontScaler* scaler) { |
SkIRect bounds; |
- if (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(packed)) { |
+ if (fUseDistanceField) { |
if (!scaler->getPackedGlyphDFBounds(packed, &bounds)) { |
return NULL; |
} |
@@ -290,9 +290,7 @@ |
bool GrTextStrike::glyphTooLargeForAtlas(GrGlyph* glyph) { |
int width = glyph->fBounds.width(); |
int height = glyph->fBounds.height(); |
- bool useDistanceField = |
- (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(glyph->fPackedID)); |
- int pad = useDistanceField ? 2 * SK_DistanceFieldPad : 0; |
+ int pad = fUseDistanceField ? 2 * SK_DistanceFieldPad : 0; |
int plotWidth = (kA8_GrMaskFormat == glyph->fMaskFormat) ? GR_FONT_ATLAS_A8_PLOT_WIDTH |
: GR_FONT_ATLAS_PLOT_WIDTH; |
if (width + pad > plotWidth) { |
@@ -323,7 +321,7 @@ |
size_t size = glyph->fBounds.area() * bytesPerPixel; |
GrAutoMalloc<1024> storage(size); |
- if (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(glyph->fPackedID)) { |
+ if (fUseDistanceField) { |
if (!scaler->getPackedGlyphDFImage(glyph->fPackedID, glyph->width(), |
glyph->height(), |
storage.get())) { |