OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 The Android Open Source Project | 3 * Copyright 2012 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkPaintOptionsAndroid_DEFINED | 10 #ifndef SkPaintOptionsAndroid_DEFINED |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 private: | 55 private: |
56 //! BCP 47 language identifier | 56 //! BCP 47 language identifier |
57 SkString fTag; | 57 SkString fTag; |
58 }; | 58 }; |
59 | 59 |
60 class SkPaintOptionsAndroid { | 60 class SkPaintOptionsAndroid { |
61 public: | 61 public: |
62 SkPaintOptionsAndroid() { | 62 SkPaintOptionsAndroid() { |
63 fFontVariant = kDefault_Variant; | 63 fFontVariant = kDefault_Variant; |
| 64 fUseFontFallbacks = false; |
64 } | 65 } |
65 | 66 |
66 SkPaintOptionsAndroid& operator=(const SkPaintOptionsAndroid& b) { | 67 SkPaintOptionsAndroid& operator=(const SkPaintOptionsAndroid& b) { |
67 fLanguage = b.fLanguage; | 68 fLanguage = b.fLanguage; |
68 fFontVariant = b.fFontVariant; | 69 fFontVariant = b.fFontVariant; |
| 70 fUseFontFallbacks = b.fUseFontFallbacks; |
69 return *this; | 71 return *this; |
70 } | 72 } |
71 | 73 |
72 bool operator!=(const SkPaintOptionsAndroid& b) const { | 74 bool operator!=(const SkPaintOptionsAndroid& b) const { |
73 return fLanguage != b.fLanguage || fFontVariant != b.fFontVariant; | 75 return fLanguage != b.fLanguage || |
| 76 fFontVariant != b.fFontVariant || |
| 77 fUseFontFallbacks != b.fUseFontFallbacks; |
74 } | 78 } |
75 | 79 |
76 void flatten(SkFlattenableWriteBuffer&) const; | 80 void flatten(SkFlattenableWriteBuffer&) const; |
77 void unflatten(SkFlattenableReadBuffer&); | 81 void unflatten(SkFlattenableReadBuffer&); |
78 | 82 |
79 /** Return the paint's language value used for drawing text. | 83 /** Return the paint's language value used for drawing text. |
80 @return the paint's language value used for drawing text. | 84 @return the paint's language value used for drawing text. |
81 */ | 85 */ |
82 const SkLanguage& getLanguage() const { return fLanguage; } | 86 const SkLanguage& getLanguage() const { return fLanguage; } |
83 | 87 |
(...skipping 17 matching lines...) Expand all Loading... |
101 FontVariant getFontVariant() const { return fFontVariant; } | 105 FontVariant getFontVariant() const { return fFontVariant; } |
102 | 106 |
103 /** Set the font variant | 107 /** Set the font variant |
104 @param fontVariant set the paint's font variant for choosing fonts | 108 @param fontVariant set the paint's font variant for choosing fonts |
105 */ | 109 */ |
106 void setFontVariant(FontVariant fontVariant) { | 110 void setFontVariant(FontVariant fontVariant) { |
107 SkASSERT((unsigned)fontVariant <= kLast_Variant); | 111 SkASSERT((unsigned)fontVariant <= kLast_Variant); |
108 fFontVariant = fontVariant; | 112 fFontVariant = fontVariant; |
109 } | 113 } |
110 | 114 |
| 115 bool isUsingFontFallbacks() const { return fUseFontFallbacks; } |
| 116 |
| 117 void setUseFontFallbacks(bool useFontFallbacks) { |
| 118 fUseFontFallbacks = useFontFallbacks; |
| 119 } |
| 120 |
111 private: | 121 private: |
112 SkLanguage fLanguage; | 122 SkLanguage fLanguage; |
113 FontVariant fFontVariant; | 123 FontVariant fFontVariant; |
| 124 bool fUseFontFallbacks; |
114 }; | 125 }; |
115 | 126 |
116 #endif // #ifdef SK_BUILD_FOR_ANDROID | 127 #endif // #ifdef SK_BUILD_FOR_ANDROID |
117 #endif // #ifndef SkPaintOptionsAndroid_DEFINED | 128 #endif // #ifndef SkPaintOptionsAndroid_DEFINED |
OLD | NEW |