Chromium Code Reviews| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 * If there is no 1:1 mapping from the unichar to a glyph id, returns 0. | 259 * If there is no 1:1 mapping from the unichar to a glyph id, returns 0. |
| 260 */ | 260 */ |
| 261 virtual uint16_t generateCharToGlyph(SkUnichar unichar) = 0; | 261 virtual uint16_t generateCharToGlyph(SkUnichar unichar) = 0; |
| 262 | 262 |
| 263 /** Returns the unichar for the given glyph id. | 263 /** Returns the unichar for the given glyph id. |
| 264 * If there is no 1:1 mapping from the glyph id to a unichar, returns 0. | 264 * If there is no 1:1 mapping from the glyph id to a unichar, returns 0. |
| 265 * The default implementation always returns 0, indicating failure. | 265 * The default implementation always returns 0, indicating failure. |
| 266 */ | 266 */ |
| 267 virtual SkUnichar generateGlyphToChar(uint16_t glyphId); | 267 virtual SkUnichar generateGlyphToChar(uint16_t glyphId); |
| 268 | 268 |
| 269 /** In case of Bitmap font like Colored Emoji font we need to disable | |
| 270 * fGenerateImageFromPath as generating image from path is not possible. | |
| 271 */ | |
| 272 void updateImageFromPath(bool value) { fGenerateImageFromPath = value; } | |
|
reed1
2014/09/05 13:29:42
can we combine these two, and only have one method
h.joshi
2014/09/05 14:06:31
Done.
| |
| 273 | |
| 269 void forceGenerateImageFromPath() { fGenerateImageFromPath = true; } | 274 void forceGenerateImageFromPath() { fGenerateImageFromPath = true; } |
| 270 | 275 |
| 271 private: | 276 private: |
| 272 // never null | 277 // never null |
| 273 SkAutoTUnref<SkTypeface> fTypeface; | 278 SkAutoTUnref<SkTypeface> fTypeface; |
| 274 | 279 |
| 275 #ifdef SK_BUILD_FOR_ANDROID | 280 #ifdef SK_BUILD_FOR_ANDROID |
| 276 SkPaintOptionsAndroid fPaintOptionsAndroid; | 281 SkPaintOptionsAndroid fPaintOptionsAndroid; |
| 277 #endif | 282 #endif |
| 278 | 283 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 349 return static_cast<SkPaint::Hinting>(hint); | 354 return static_cast<SkPaint::Hinting>(hint); |
| 350 } | 355 } |
| 351 | 356 |
| 352 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { | 357 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { |
| 353 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | | 358 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | |
| 354 (hinting << SkScalerContext::kHinting_Shift); | 359 (hinting << SkScalerContext::kHinting_Shift); |
| 355 } | 360 } |
| 356 | 361 |
| 357 | 362 |
| 358 #endif | 363 #endif |
| OLD | NEW |