OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrFontScaler.h" | 9 #include "GrFontScaler.h" |
10 #include "SkDescriptor.h" | 10 #include "SkDescriptor.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 case SkMask::kARGB32_Format: | 34 case SkMask::kARGB32_Format: |
35 return kARGB_GrMaskFormat; | 35 return kARGB_GrMaskFormat; |
36 default: | 36 default: |
37 SkDEBUGFAIL("unsupported SkMask::Format"); | 37 SkDEBUGFAIL("unsupported SkMask::Format"); |
38 return kA8_GrMaskFormat; | 38 return kA8_GrMaskFormat; |
39 } | 39 } |
40 } | 40 } |
41 | 41 |
42 const GrFontDescKey* GrFontScaler::getKey() { | 42 const GrFontDescKey* GrFontScaler::getKey() { |
43 if (NULL == fKey) { | 43 if (NULL == fKey) { |
44 fKey = SkNEW_ARGS(GrFontDescKey, (fStrike->getDescriptor())); | 44 fKey = new GrFontDescKey(fStrike->getDescriptor()); |
45 } | 45 } |
46 return fKey; | 46 return fKey; |
47 } | 47 } |
48 | 48 |
49 GrMaskFormat GrFontScaler::getPackedGlyphMaskFormat(const SkGlyph& glyph) const
{ | 49 GrMaskFormat GrFontScaler::getPackedGlyphMaskFormat(const SkGlyph& glyph) const
{ |
50 SkMask::Format format = static_cast<SkMask::Format>(glyph.fMaskFormat); | 50 SkMask::Format format = static_cast<SkMask::Format>(glyph.fMaskFormat); |
51 switch (format) { | 51 switch (format) { |
52 case SkMask::kBW_Format: | 52 case SkMask::kBW_Format: |
53 // fall through to kA8 -- we store BW glyphs in our 8-bit cache | 53 // fall through to kA8 -- we store BW glyphs in our 8-bit cache |
54 case SkMask::kA8_Format: | 54 case SkMask::kA8_Format: |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 const SkPath* GrFontScaler::getGlyphPath(const SkGlyph& glyph) { | 199 const SkPath* GrFontScaler::getGlyphPath(const SkGlyph& glyph) { |
200 return fStrike->findPath(glyph); | 200 return fStrike->findPath(glyph); |
201 } | 201 } |
202 | 202 |
203 const SkGlyph& GrFontScaler::grToSkGlyph(GrGlyph::PackedID id) { | 203 const SkGlyph& GrFontScaler::grToSkGlyph(GrGlyph::PackedID id) { |
204 return fStrike->getGlyphIDMetrics(GrGlyph::UnpackID(id), | 204 return fStrike->getGlyphIDMetrics(GrGlyph::UnpackID(id), |
205 GrGlyph::UnpackFixedX(id), | 205 GrGlyph::UnpackFixedX(id), |
206 GrGlyph::UnpackFixedY(id)); | 206 GrGlyph::UnpackFixedY(id)); |
207 } | 207 } |
OLD | NEW |