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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 /** Returns the unichar for the given glyph id. | 294 /** Returns the unichar for the given glyph id. |
295 * If there is no 1:1 mapping from the glyph id to a unichar, returns 0. | 295 * If there is no 1:1 mapping from the glyph id to a unichar, returns 0. |
296 * The default implementation always returns 0, indicating failure. | 296 * The default implementation always returns 0, indicating failure. |
297 */ | 297 */ |
298 virtual SkUnichar generateGlyphToChar(uint16_t glyphId); | 298 virtual SkUnichar generateGlyphToChar(uint16_t glyphId); |
299 | 299 |
300 void forceGenerateImageFromPath() { fGenerateImageFromPath = true; } | 300 void forceGenerateImageFromPath() { fGenerateImageFromPath = true; } |
301 void forceOffGenerateImageFromPath() { fGenerateImageFromPath = false; } | 301 void forceOffGenerateImageFromPath() { fGenerateImageFromPath = false; } |
302 | 302 |
303 private: | 303 private: |
| 304 friend class SkRandomScalerContext; // For debug purposes |
| 305 |
304 // never null | 306 // never null |
305 SkAutoTUnref<SkTypeface> fTypeface; | 307 SkAutoTUnref<SkTypeface> fTypeface; |
306 | 308 |
307 // optional object, which may be null | 309 // optional object, which may be null |
308 SkPathEffect* fPathEffect; | 310 SkPathEffect* fPathEffect; |
309 SkMaskFilter* fMaskFilter; | 311 SkMaskFilter* fMaskFilter; |
310 SkRasterizer* fRasterizer; | 312 SkRasterizer* fRasterizer; |
311 | 313 |
312 // if this is set, we draw the image from a path, rather than | 314 // if this is set, we draw the image from a path, rather than |
313 // calling generateImage. | 315 // calling generateImage. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 return static_cast<SkPaint::Hinting>(hint); | 362 return static_cast<SkPaint::Hinting>(hint); |
361 } | 363 } |
362 | 364 |
363 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { | 365 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { |
364 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | | 366 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | |
365 (hinting << SkScalerContext::kHinting_Shift); | 367 (hinting << SkScalerContext::kHinting_Shift); |
366 } | 368 } |
367 | 369 |
368 | 370 |
369 #endif | 371 #endif |
OLD | NEW |