| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkGlyph_DEFINED | 8 #ifndef SkGlyph_DEFINED |
| 9 #define SkGlyph_DEFINED | 9 #define SkGlyph_DEFINED |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool isFullMetrics() const { | 71 bool isFullMetrics() const { |
| 72 return MASK_FORMAT_JUST_ADVANCE != fMaskFormat; | 72 return MASK_FORMAT_JUST_ADVANCE != fMaskFormat; |
| 73 } | 73 } |
| 74 | 74 |
| 75 uint16_t getGlyphID() const { | 75 uint16_t getGlyphID() const { |
| 76 return ID2Code(fID); | 76 return ID2Code(fID); |
| 77 } | 77 } |
| 78 | 78 |
| 79 unsigned getGlyphID(unsigned baseGlyphCount) const { | |
| 80 unsigned code = ID2Code(fID); | |
| 81 SkASSERT(code >= baseGlyphCount); | |
| 82 return code - baseGlyphCount; | |
| 83 } | |
| 84 | |
| 85 unsigned getSubX() const { | 79 unsigned getSubX() const { |
| 86 return ID2SubX(fID); | 80 return ID2SubX(fID); |
| 87 } | 81 } |
| 88 | 82 |
| 89 SkFixed getSubXFixed() const { | 83 SkFixed getSubXFixed() const { |
| 90 return SubToFixed(ID2SubX(fID)); | 84 return SubToFixed(ID2SubX(fID)); |
| 91 } | 85 } |
| 92 | 86 |
| 93 SkFixed getSubYFixed() const { | 87 SkFixed getSubYFixed() const { |
| 94 return SubToFixed(ID2SubY(fID)); | 88 return SubToFixed(ID2SubY(fID)); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 y = FixedToSub(y); | 137 y = FixedToSub(y); |
| 144 return (x << (kSubShift + kSubShiftX)) | | 138 return (x << (kSubShift + kSubShiftX)) | |
| 145 (y << (kSubShift + kSubShiftY)) | | 139 (y << (kSubShift + kSubShiftY)) | |
| 146 code; | 140 code; |
| 147 } | 141 } |
| 148 | 142 |
| 149 void toMask(SkMask* mask) const; | 143 void toMask(SkMask* mask) const; |
| 150 }; | 144 }; |
| 151 | 145 |
| 152 #endif | 146 #endif |
| OLD | NEW |