| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 * If there is no 1:1 mapping from the unichar to a glyph id, returns 0. | 244 * If there is no 1:1 mapping from the unichar to a glyph id, returns 0. |
| 245 */ | 245 */ |
| 246 virtual uint16_t generateCharToGlyph(SkUnichar unichar) = 0; | 246 virtual uint16_t generateCharToGlyph(SkUnichar unichar) = 0; |
| 247 | 247 |
| 248 /** Returns the unichar for the given glyph id. | 248 /** Returns the unichar for the given glyph id. |
| 249 * If there is no 1:1 mapping from the glyph id to a unichar, returns 0. | 249 * If there is no 1:1 mapping from the glyph id to a unichar, returns 0. |
| 250 * The default implementation always returns 0, indicating failure. | 250 * The default implementation always returns 0, indicating failure. |
| 251 */ | 251 */ |
| 252 virtual SkUnichar generateGlyphToChar(uint16_t glyphId); | 252 virtual SkUnichar generateGlyphToChar(uint16_t glyphId); |
| 253 | 253 |
| 254 void forceGenerateImageFromPath() { fGenerateImageFromPath = true; } | 254 /** In case of Bitmap font like Colored Emoji font we need to disable |
| 255 * fGenerateImageFromPath as generating image from path is not possible. |
| 256 */ |
| 257 void setGenerateImageFromPath(bool value) { fGenerateImageFromPath = value;
} |
| 255 | 258 |
| 256 private: | 259 private: |
| 257 // never null | 260 // never null |
| 258 SkAutoTUnref<SkTypeface> fTypeface; | 261 SkAutoTUnref<SkTypeface> fTypeface; |
| 259 | 262 |
| 260 // optional object, which may be null | 263 // optional object, which may be null |
| 261 SkPathEffect* fPathEffect; | 264 SkPathEffect* fPathEffect; |
| 262 SkMaskFilter* fMaskFilter; | 265 SkMaskFilter* fMaskFilter; |
| 263 SkRasterizer* fRasterizer; | 266 SkRasterizer* fRasterizer; |
| 264 | 267 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 return static_cast<SkPaint::Hinting>(hint); | 316 return static_cast<SkPaint::Hinting>(hint); |
| 314 } | 317 } |
| 315 | 318 |
| 316 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { | 319 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { |
| 317 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | | 320 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | |
| 318 (hinting << SkScalerContext::kHinting_Shift); | 321 (hinting << SkScalerContext::kHinting_Shift); |
| 319 } | 322 } |
| 320 | 323 |
| 321 | 324 |
| 322 #endif | 325 #endif |
| OLD | NEW |