| 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 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 struct SkGlyph { | 23 struct SkGlyph { |
| 24 void* fImage; | 24 void* fImage; |
| 25 SkPath* fPath; | 25 SkPath* fPath; |
| 26 SkFixed fAdvanceX, fAdvanceY; | 26 SkFixed fAdvanceX, fAdvanceY; |
| 27 | 27 |
| 28 uint32_t fID; | 28 uint32_t fID; |
| 29 uint16_t fWidth, fHeight; | 29 uint16_t fWidth, fHeight; |
| 30 int16_t fTop, fLeft; | 30 int16_t fTop, fLeft; |
| 31 | 31 |
| 32 void* fDistanceField; |
| 32 uint8_t fMaskFormat; | 33 uint8_t fMaskFormat; |
| 33 int8_t fRsbDelta, fLsbDelta; // used by auto-kerning | 34 int8_t fRsbDelta, fLsbDelta; // used by auto-kerning |
| 34 | 35 |
| 35 void init(uint32_t id) { | 36 void init(uint32_t id) { |
| 36 fID = id; | 37 fID = id; |
| 37 fImage = NULL; | 38 fImage = NULL; |
| 38 fPath = NULL; | 39 fPath = NULL; |
| 40 fDistanceField = NULL; |
| 39 fMaskFormat = MASK_FORMAT_UNKNOWN; | 41 fMaskFormat = MASK_FORMAT_UNKNOWN; |
| 40 } | 42 } |
| 41 | 43 |
| 42 /** | 44 /** |
| 43 * Compute the rowbytes for the specified width and mask-format. | 45 * Compute the rowbytes for the specified width and mask-format. |
| 44 */ | 46 */ |
| 45 static unsigned ComputeRowBytes(unsigned width, SkMask::Format format) { | 47 static unsigned ComputeRowBytes(unsigned width, SkMask::Format format) { |
| 46 unsigned rb = width; | 48 unsigned rb = width; |
| 47 if (SkMask::kBW_Format == format) { | 49 if (SkMask::kBW_Format == format) { |
| 48 rb = (rb + 7) >> 3; | 50 rb = (rb + 7) >> 3; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 y = FixedToSub(y); | 143 y = FixedToSub(y); |
| 142 return (x << (kSubShift + kSubShiftX)) | | 144 return (x << (kSubShift + kSubShiftX)) | |
| 143 (y << (kSubShift + kSubShiftY)) | | 145 (y << (kSubShift + kSubShiftY)) | |
| 144 code; | 146 code; |
| 145 } | 147 } |
| 146 | 148 |
| 147 void toMask(SkMask* mask) const; | 149 void toMask(SkMask* mask) const; |
| 148 }; | 150 }; |
| 149 | 151 |
| 150 #endif | 152 #endif |
| OLD | NEW |