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 |
11 #define SkPaintOptionsAndroid_DEFINED | 11 #define SkPaintOptionsAndroid_DEFINED |
12 | 12 |
13 #include "SkTypes.h" | 13 #include "SkTypes.h" |
14 #include "SkString.h" | 14 #include "SkString.h" |
15 | 15 |
16 class SkFlattenableReadBuffer; | 16 class SkReadBuffer; |
17 class SkFlattenableWriteBuffer; | 17 class SkWriteBuffer; |
18 | 18 |
19 /** \class SkLanguage | 19 /** \class SkLanguage |
20 | 20 |
21 The SkLanguage class represents a human written language, and is used by | 21 The SkLanguage class represents a human written language, and is used by |
22 text draw operations to determine which glyph to draw when drawing | 22 text draw operations to determine which glyph to draw when drawing |
23 characters with variants (ie Han-derived characters). | 23 characters with variants (ie Han-derived characters). |
24 */ | 24 */ |
25 class SkLanguage { | 25 class SkLanguage { |
26 public: | 26 public: |
27 SkLanguage() { } | 27 SkLanguage() { } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 bool operator==(const SkPaintOptionsAndroid& b) const { | 73 bool operator==(const SkPaintOptionsAndroid& b) const { |
74 return !(*this != b); | 74 return !(*this != b); |
75 } | 75 } |
76 | 76 |
77 bool operator!=(const SkPaintOptionsAndroid& b) const { | 77 bool operator!=(const SkPaintOptionsAndroid& b) const { |
78 return fLanguage != b.fLanguage || | 78 return fLanguage != b.fLanguage || |
79 fFontVariant != b.fFontVariant || | 79 fFontVariant != b.fFontVariant || |
80 fUseFontFallbacks != b.fUseFontFallbacks; | 80 fUseFontFallbacks != b.fUseFontFallbacks; |
81 } | 81 } |
82 | 82 |
83 void flatten(SkFlattenableWriteBuffer&) const; | 83 void flatten(SkWriteBuffer&) const; |
84 void unflatten(SkFlattenableReadBuffer&); | 84 void unflatten(SkReadBuffer&); |
85 | 85 |
86 /** Return the paint's language value used for drawing text. | 86 /** Return the paint's language value used for drawing text. |
87 @return the paint's language value used for drawing text. | 87 @return the paint's language value used for drawing text. |
88 */ | 88 */ |
89 const SkLanguage& getLanguage() const { return fLanguage; } | 89 const SkLanguage& getLanguage() const { return fLanguage; } |
90 | 90 |
91 /** Set the paint's language value used for drawing text. | 91 /** Set the paint's language value used for drawing text. |
92 @param language set the paint's language value for drawing text. | 92 @param language set the paint's language value for drawing text. |
93 */ | 93 */ |
94 void setLanguage(const SkLanguage& language) { fLanguage = language; } | 94 void setLanguage(const SkLanguage& language) { fLanguage = language; } |
(...skipping 26 matching lines...) Expand all Loading... |
121 fUseFontFallbacks = useFontFallbacks; | 121 fUseFontFallbacks = useFontFallbacks; |
122 } | 122 } |
123 | 123 |
124 private: | 124 private: |
125 SkLanguage fLanguage; | 125 SkLanguage fLanguage; |
126 FontVariant fFontVariant; | 126 FontVariant fFontVariant; |
127 bool fUseFontFallbacks; | 127 bool fUseFontFallbacks; |
128 }; | 128 }; |
129 | 129 |
130 #endif // #ifndef SkPaintOptionsAndroid_DEFINED | 130 #endif // #ifndef SkPaintOptionsAndroid_DEFINED |
OLD | NEW |