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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 fForceBW = 0; | 43 fForceBW = 0; |
44 } | 44 } |
45 | 45 |
46 /** | 46 /** |
47 * Compute the rowbytes for the specified width and mask-format. | 47 * Compute the rowbytes for the specified width and mask-format. |
48 */ | 48 */ |
49 static unsigned ComputeRowBytes(unsigned width, SkMask::Format format) { | 49 static unsigned ComputeRowBytes(unsigned width, SkMask::Format format) { |
50 unsigned rb = width; | 50 unsigned rb = width; |
51 if (SkMask::kBW_Format == format) { | 51 if (SkMask::kBW_Format == format) { |
52 rb = (rb + 7) >> 3; | 52 rb = (rb + 7) >> 3; |
53 } else if (SkMask::kARGB32_Format == format || | 53 } else if (SkMask::kARGB32_Format == format) { |
54 SkMask::kLCD32_Format == format) | |
55 { | |
56 rb <<= 2; | 54 rb <<= 2; |
57 } else if (SkMask::kLCD16_Format == format) { | 55 } else if (SkMask::kLCD16_Format == format) { |
58 rb = SkAlign4(rb << 1); | 56 rb = SkAlign4(rb << 1); |
59 } else { | 57 } else { |
60 rb = SkAlign4(rb); | 58 rb = SkAlign4(rb); |
61 } | 59 } |
62 return rb; | 60 return rb; |
63 } | 61 } |
64 | 62 |
65 unsigned rowBytes() const { | 63 unsigned rowBytes() const { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 y = FixedToSub(y); | 137 y = FixedToSub(y); |
140 return (x << (kSubShift + kSubShiftX)) | | 138 return (x << (kSubShift + kSubShiftX)) | |
141 (y << (kSubShift + kSubShiftY)) | | 139 (y << (kSubShift + kSubShiftY)) | |
142 code; | 140 code; |
143 } | 141 } |
144 | 142 |
145 void toMask(SkMask* mask) const; | 143 void toMask(SkMask* mask) const; |
146 }; | 144 }; |
147 | 145 |
148 #endif | 146 #endif |
OLD | NEW |