| 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 SkScalerContext_DEFINED | 8 #ifndef SkScalerContext_DEFINED |
| 9 #define SkScalerContext_DEFINED | 9 #define SkScalerContext_DEFINED |
| 10 | 10 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 kSubpixelPositioning_Flag = 0x0010, | 127 kSubpixelPositioning_Flag = 0x0010, |
| 128 kAutohinting_Flag = 0x0020, | 128 kAutohinting_Flag = 0x0020, |
| 129 kVertical_Flag = 0x0040, | 129 kVertical_Flag = 0x0040, |
| 130 | 130 |
| 131 // together, these two flags resulting in a two bit value which matches | 131 // together, these two flags resulting in a two bit value which matches |
| 132 // up with the SkPaint::Hinting enum. | 132 // up with the SkPaint::Hinting enum. |
| 133 kHinting_Shift = 7, // to shift into the other flags above | 133 kHinting_Shift = 7, // to shift into the other flags above |
| 134 kHintingBit1_Flag = 0x0080, | 134 kHintingBit1_Flag = 0x0080, |
| 135 kHintingBit2_Flag = 0x0100, | 135 kHintingBit2_Flag = 0x0100, |
| 136 | 136 |
| 137 // these should only ever be set if fMaskFormat is LCD16 or LCD32 | 137 // Pixel geometry information. |
| 138 // only meaningful if fMaskFormat is LCD16 or LCD32 |
| 138 kLCD_Vertical_Flag = 0x0200, // else Horizontal | 139 kLCD_Vertical_Flag = 0x0200, // else Horizontal |
| 139 kLCD_BGROrder_Flag = 0x0400, // else RGB order | 140 kLCD_BGROrder_Flag = 0x0400, // else RGB order |
| 140 | 141 |
| 141 // Generate A8 from LCD source (for GDI), only meaningful if fMaskFormat
is kA8 | 142 // Generate A8 from LCD source (for GDI and CoreGraphics). |
| 142 // Perhaps we can store this (instead) in fMaskFormat, in hight bit? | 143 // only meaningful if fMaskFormat is kA8 |
| 143 kGenA8FromLCD_Flag = 0x0800, | 144 kGenA8FromLCD_Flag = 0x0800, // could be 0x200 (bit meaning depen
dent on fMaskFormat) |
| 144 }; | 145 }; |
| 145 | 146 |
| 146 // computed values | 147 // computed values |
| 147 enum { | 148 enum { |
| 148 kHinting_Mask = kHintingBit1_Flag | kHintingBit2_Flag, | 149 kHinting_Mask = kHintingBit1_Flag | kHintingBit2_Flag, |
| 149 }; | 150 }; |
| 150 | 151 |
| 151 | 152 |
| 152 SkScalerContext(SkTypeface*, const SkDescriptor*); | 153 SkScalerContext(SkTypeface*, const SkDescriptor*); |
| 153 virtual ~SkScalerContext(); | 154 virtual ~SkScalerContext(); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 return static_cast<SkPaint::Hinting>(hint); | 299 return static_cast<SkPaint::Hinting>(hint); |
| 299 } | 300 } |
| 300 | 301 |
| 301 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { | 302 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { |
| 302 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | | 303 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | |
| 303 (hinting << SkScalerContext::kHinting_Shift); | 304 (hinting << SkScalerContext::kHinting_Shift); |
| 304 } | 305 } |
| 305 | 306 |
| 306 | 307 |
| 307 #endif | 308 #endif |
| OLD | NEW |