OLD | NEW |
1 | 1 |
2 | 2 |
3 /* | 3 /* |
4 * Copyright 2006 The Android Open Source Project | 4 * Copyright 2006 The Android Open Source Project |
5 * | 5 * |
6 * Use of this source code is governed by a BSD-style license that can be | 6 * Use of this source code is governed by a BSD-style license that can be |
7 * found in the LICENSE file. | 7 * found in the LICENSE file. |
8 */ | 8 */ |
9 | 9 |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 #define kBicubicFilterBitmap_Flag kHighQualityFilterBitmap_Flag | 46 #define kBicubicFilterBitmap_Flag kHighQualityFilterBitmap_Flag |
47 | 47 |
48 /** \class SkPaint | 48 /** \class SkPaint |
49 | 49 |
50 The SkPaint class holds the style and color information about how to draw | 50 The SkPaint class holds the style and color information about how to draw |
51 geometries, text and bitmaps. | 51 geometries, text and bitmaps. |
52 */ | 52 */ |
53 | 53 |
54 class SK_API SkPaint { | 54 class SK_API SkPaint { |
| 55 enum { |
| 56 // DEPRECATED -- use setFilterLevel instead |
| 57 kFilterBitmap_Flag = 0x02, // temporary flag |
| 58 // DEPRECATED -- use setFilterLevel instead |
| 59 kHighQualityFilterBitmap_Flag = 0x4000, // temporary flag |
| 60 // DEPRECATED -- use setFilterLevel instead |
| 61 kHighQualityDownsampleBitmap_Flag = 0x8000, // temporary flag |
| 62 }; |
55 public: | 63 public: |
56 SkPaint(); | 64 SkPaint(); |
57 SkPaint(const SkPaint& paint); | 65 SkPaint(const SkPaint& paint); |
58 ~SkPaint(); | 66 ~SkPaint(); |
59 | 67 |
60 SkPaint& operator=(const SkPaint&); | 68 SkPaint& operator=(const SkPaint&); |
61 | 69 |
62 SK_API friend bool operator==(const SkPaint& a, const SkPaint& b); | 70 SK_API friend bool operator==(const SkPaint& a, const SkPaint& b); |
63 friend bool operator!=(const SkPaint& a, const SkPaint& b) { | 71 friend bool operator!=(const SkPaint& a, const SkPaint& b) { |
64 return !(a == b); | 72 return !(a == b); |
(...skipping 26 matching lines...) Expand all Loading... |
91 Hinting getHinting() const { | 99 Hinting getHinting() const { |
92 return static_cast<Hinting>(fHinting); | 100 return static_cast<Hinting>(fHinting); |
93 } | 101 } |
94 | 102 |
95 void setHinting(Hinting hintingLevel); | 103 void setHinting(Hinting hintingLevel); |
96 | 104 |
97 /** Specifies the bit values that are stored in the paint's flags. | 105 /** Specifies the bit values that are stored in the paint's flags. |
98 */ | 106 */ |
99 enum Flags { | 107 enum Flags { |
100 kAntiAlias_Flag = 0x01, //!< mask to enable antialiasing | 108 kAntiAlias_Flag = 0x01, //!< mask to enable antialiasing |
101 | |
102 // DEPRECATED -- use setFilterLevel instead | |
103 kFilterBitmap_Flag = 0x02, // temporary flag | |
104 | |
105 kDither_Flag = 0x04, //!< mask to enable dithering | 109 kDither_Flag = 0x04, //!< mask to enable dithering |
106 kUnderlineText_Flag = 0x08, //!< mask to enable underline text | 110 kUnderlineText_Flag = 0x08, //!< mask to enable underline text |
107 kStrikeThruText_Flag = 0x10, //!< mask to enable strike-thru text | 111 kStrikeThruText_Flag = 0x10, //!< mask to enable strike-thru text |
108 kFakeBoldText_Flag = 0x20, //!< mask to enable fake-bold text | 112 kFakeBoldText_Flag = 0x20, //!< mask to enable fake-bold text |
109 kLinearText_Flag = 0x40, //!< mask to enable linear-text | 113 kLinearText_Flag = 0x40, //!< mask to enable linear-text |
110 kSubpixelText_Flag = 0x80, //!< mask to enable subpixel text positi
oning | 114 kSubpixelText_Flag = 0x80, //!< mask to enable subpixel text positi
oning |
111 kDevKernText_Flag = 0x100, //!< mask to enable device kerning text | 115 kDevKernText_Flag = 0x100, //!< mask to enable device kerning text |
112 kLCDRenderText_Flag = 0x200, //!< mask to enable subpixel glyph rende
rering | 116 kLCDRenderText_Flag = 0x200, //!< mask to enable subpixel glyph rende
rering |
113 kEmbeddedBitmapText_Flag = 0x400, //!< mask to enable embedded bitmap st
rikes | 117 kEmbeddedBitmapText_Flag = 0x400, //!< mask to enable embedded bitmap st
rikes |
114 kAutoHinting_Flag = 0x800, //!< mask to force Freetype's autohinter | 118 kAutoHinting_Flag = 0x800, //!< mask to force Freetype's autohinter |
115 kVerticalText_Flag = 0x1000, | 119 kVerticalText_Flag = 0x1000, |
116 kGenA8FromLCD_Flag = 0x2000, // hack for GDI -- do not use if you can
help it | 120 kGenA8FromLCD_Flag = 0x2000, // hack for GDI -- do not use if you can
help it |
117 | |
118 // DEPRECATED -- use setFilterLevel instead | |
119 kHighQualityFilterBitmap_Flag = 0x4000, // temporary flag | |
120 // DEPRECATED -- use setFilterLevel instead | |
121 kHighQualityDownsampleBitmap_Flag = 0x8000, // temporary flag | |
122 | |
123 // when adding extra flags, note that the fFlags member is specified | 121 // when adding extra flags, note that the fFlags member is specified |
124 // with a bit-width and you'll have to expand it. | 122 // with a bit-width and you'll have to expand it. |
125 | 123 |
126 kAllFlags = 0xFFFF | 124 kAllFlags = 0xFFFF |
127 }; | 125 }; |
128 | 126 |
129 /** Return the paint's flags. Use the Flag enum to test flag values. | 127 /** Return the paint's flags. Use the Flag enum to test flag values. |
130 @return the paint's flags (see enums ending in _Flag for bit masks) | 128 @return the paint's flags (see enums ending in _Flag for bit masks) |
131 */ | 129 */ |
132 uint32_t getFlags() const { return fFlags; } | 130 uint32_t getFlags() const { return fFlags; } |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 #ifdef SK_BUILD_FOR_ANDROID | 1096 #ifdef SK_BUILD_FOR_ANDROID |
1099 SkPaintOptionsAndroid fPaintOptionsAndroid; | 1097 SkPaintOptionsAndroid fPaintOptionsAndroid; |
1100 | 1098 |
1101 // In order for the == operator to work properly this must be the last field | 1099 // In order for the == operator to work properly this must be the last field |
1102 // in the struct so that we can do a memcmp to this field's offset. | 1100 // in the struct so that we can do a memcmp to this field's offset. |
1103 uint32_t fGenerationID; | 1101 uint32_t fGenerationID; |
1104 #endif | 1102 #endif |
1105 }; | 1103 }; |
1106 | 1104 |
1107 #endif | 1105 #endif |
OLD | NEW |