| Index: src/gpu/GrFontScaler.cpp
|
| diff --git a/src/gpu/GrFontScaler.cpp b/src/gpu/GrFontScaler.cpp
|
| index 164768f3b08bbfe29f67f226486bca99e1173e8e..612bb4845b1d76b972a61171ece63be246f78a5a 100644
|
| --- a/src/gpu/GrFontScaler.cpp
|
| +++ b/src/gpu/GrFontScaler.cpp
|
| @@ -85,6 +85,28 @@ const GrFontDescKey* GrFontScaler::getKey() {
|
| return fKey;
|
| }
|
|
|
| +GrMaskFormat GrFontScaler::getPackedGlyphMaskFormat(GrGlyph::PackedID packed) {
|
| + const SkGlyph& glyph = fStrike->getGlyphIDMetrics(GrGlyph::UnpackID(packed),
|
| + GrGlyph::UnpackFixedX(packed),
|
| + GrGlyph::UnpackFixedY(packed));
|
| + SkMask::Format format = static_cast<SkMask::Format>(glyph.fMaskFormat);
|
| + switch (format) {
|
| + case SkMask::kBW_Format:
|
| + // fall through to kA8 -- we store BW glyphs in our 8-bit cache
|
| + case SkMask::kA8_Format:
|
| + return kA8_GrMaskFormat;
|
| + case SkMask::kLCD16_Format:
|
| + return kA565_GrMaskFormat;
|
| + case SkMask::kLCD32_Format:
|
| + return kA888_GrMaskFormat;
|
| + case SkMask::kARGB32_Format:
|
| + return kARGB_GrMaskFormat;
|
| + default:
|
| + SkDEBUGFAIL("unsupported SkMask::Format");
|
| + return kA8_GrMaskFormat;
|
| + }
|
| +}
|
| +
|
| bool GrFontScaler::getPackedGlyphBounds(GrGlyph::PackedID packed, SkIRect* bounds) {
|
| const SkGlyph& glyph = fStrike->getGlyphIDMetrics(GrGlyph::UnpackID(packed),
|
| GrGlyph::UnpackFixedX(packed),
|
|
|