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 |
11 #include "SkMask.h" | 11 #include "SkMask.h" |
12 #include "SkMaskGamma.h" | 12 #include "SkMaskGamma.h" |
13 #include "SkMatrix.h" | 13 #include "SkMatrix.h" |
14 #include "SkPaint.h" | 14 #include "SkPaint.h" |
15 #include "SkTypeface.h" | 15 #include "SkTypeface.h" |
16 | 16 |
| 17 #ifdef SK_BUILD_FOR_ANDROID |
| 18 #include "SkPaintOptionsAndroid.h" |
| 19 #endif |
| 20 |
17 struct SkGlyph; | 21 struct SkGlyph; |
18 class SkDescriptor; | 22 class SkDescriptor; |
19 class SkMaskFilter; | 23 class SkMaskFilter; |
20 class SkPathEffect; | 24 class SkPathEffect; |
21 class SkRasterizer; | 25 class SkRasterizer; |
22 | 26 |
23 /* | 27 /* |
24 * To allow this to be forward-declared, it must be its own typename, rather | 28 * To allow this to be forward-declared, it must be its own typename, rather |
25 * than a nested struct inside SkScalerContext (where it started). | 29 * than a nested struct inside SkScalerContext (where it started). |
26 */ | 30 */ |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 SkPaint::FontMetrics* mY) = 0; | 214 SkPaint::FontMetrics* mY) = 0; |
211 // default impl returns 0, indicating failure. | 215 // default impl returns 0, indicating failure. |
212 virtual SkUnichar generateGlyphToChar(uint16_t); | 216 virtual SkUnichar generateGlyphToChar(uint16_t); |
213 | 217 |
214 void forceGenerateImageFromPath() { fGenerateImageFromPath = true; } | 218 void forceGenerateImageFromPath() { fGenerateImageFromPath = true; } |
215 | 219 |
216 private: | 220 private: |
217 // never null | 221 // never null |
218 SkAutoTUnref<SkTypeface> fTypeface; | 222 SkAutoTUnref<SkTypeface> fTypeface; |
219 | 223 |
| 224 #ifdef SK_BUILD_FOR_ANDROID |
| 225 SkPaintOptionsAndroid fPaintOptionsAndroid; |
| 226 #endif |
| 227 |
220 // optional object, which may be null | 228 // optional object, which may be null |
221 SkPathEffect* fPathEffect; | 229 SkPathEffect* fPathEffect; |
222 SkMaskFilter* fMaskFilter; | 230 SkMaskFilter* fMaskFilter; |
223 SkRasterizer* fRasterizer; | 231 SkRasterizer* fRasterizer; |
224 | 232 |
225 // if this is set, we draw the image from a path, rather than | 233 // if this is set, we draw the image from a path, rather than |
226 // calling generateImage. | 234 // calling generateImage. |
227 bool fGenerateImageFromPath; | 235 bool fGenerateImageFromPath; |
228 | 236 |
229 void internalGetPath(const SkGlyph& glyph, SkPath* fillPath, | 237 void internalGetPath(const SkGlyph& glyph, SkPath* fillPath, |
(...skipping 25 matching lines...) Expand all Loading... |
255 private: | 263 private: |
256 // When there is a filter, previous steps must create a linear mask | 264 // When there is a filter, previous steps must create a linear mask |
257 // and the pre-blend applied as a final step. | 265 // and the pre-blend applied as a final step. |
258 const SkMaskGamma::PreBlend fPreBlendForFilter; | 266 const SkMaskGamma::PreBlend fPreBlendForFilter; |
259 }; | 267 }; |
260 | 268 |
261 #define kRec_SkDescriptorTag SkSetFourByteTag('s', 'r', 'e', 'c') | 269 #define kRec_SkDescriptorTag SkSetFourByteTag('s', 'r', 'e', 'c') |
262 #define kPathEffect_SkDescriptorTag SkSetFourByteTag('p', 't', 'h', 'e') | 270 #define kPathEffect_SkDescriptorTag SkSetFourByteTag('p', 't', 'h', 'e') |
263 #define kMaskFilter_SkDescriptorTag SkSetFourByteTag('m', 's', 'k', 'f') | 271 #define kMaskFilter_SkDescriptorTag SkSetFourByteTag('m', 's', 'k', 'f') |
264 #define kRasterizer_SkDescriptorTag SkSetFourByteTag('r', 'a', 's', 't') | 272 #define kRasterizer_SkDescriptorTag SkSetFourByteTag('r', 'a', 's', 't') |
| 273 #ifdef SK_BUILD_FOR_ANDROID |
| 274 #define kAndroidOpts_SkDescriptorTag SkSetFourByteTag('a', 'n', 'd', 'r') |
| 275 #endif |
265 | 276 |
266 /////////////////////////////////////////////////////////////////////////////// | 277 /////////////////////////////////////////////////////////////////////////////// |
267 | 278 |
268 enum SkAxisAlignment { | 279 enum SkAxisAlignment { |
269 kNone_SkAxisAlignment, | 280 kNone_SkAxisAlignment, |
270 kX_SkAxisAlignment, | 281 kX_SkAxisAlignment, |
271 kY_SkAxisAlignment | 282 kY_SkAxisAlignment |
272 }; | 283 }; |
273 | 284 |
274 /** | 285 /** |
(...skipping 12 matching lines...) Expand all Loading... |
287 return static_cast<SkPaint::Hinting>(hint); | 298 return static_cast<SkPaint::Hinting>(hint); |
288 } | 299 } |
289 | 300 |
290 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { | 301 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { |
291 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | | 302 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | |
292 (hinting << SkScalerContext::kHinting_Shift); | 303 (hinting << SkScalerContext::kHinting_Shift); |
293 } | 304 } |
294 | 305 |
295 | 306 |
296 #endif | 307 #endif |
OLD | NEW |