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 SkPaint_DEFINED | 8 #ifndef SkPaint_DEFINED |
9 #define SkPaint_DEFINED | 9 #define SkPaint_DEFINED |
10 | 10 |
11 #include "SkColor.h" | 11 #include "SkColor.h" |
12 #include "SkDrawLooper.h" | 12 #include "SkDrawLooper.h" |
13 #include "SkFilterQuality.h" | |
13 #include "SkMatrix.h" | 14 #include "SkMatrix.h" |
14 #include "SkXfermode.h" | 15 #include "SkXfermode.h" |
15 | 16 |
16 class SkAnnotation; | 17 class SkAnnotation; |
17 class SkAutoGlyphCache; | 18 class SkAutoGlyphCache; |
18 class SkColorFilter; | 19 class SkColorFilter; |
19 class SkDescriptor; | 20 class SkDescriptor; |
20 struct SkDeviceProperties; | 21 struct SkDeviceProperties; |
21 class SkReadBuffer; | 22 class SkReadBuffer; |
22 class SkWriteBuffer; | 23 class SkWriteBuffer; |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
288 return SkToBool(this->getFlags() & kDistanceFieldTextTEMP_Flag); | 289 return SkToBool(this->getFlags() & kDistanceFieldTextTEMP_Flag); |
289 } | 290 } |
290 | 291 |
291 /** Helper for setFlags(), setting or clearing the kDistanceFieldTextTEMP_Fl ag bit | 292 /** Helper for setFlags(), setting or clearing the kDistanceFieldTextTEMP_Fl ag bit |
292 @param distanceFieldText true to set the kDistanceFieldTextTEMP_Flag bit in the paint's | 293 @param distanceFieldText true to set the kDistanceFieldTextTEMP_Flag bit in the paint's |
293 flags, false to clear it. | 294 flags, false to clear it. |
294 */ | 295 */ |
295 void setDistanceFieldTextTEMP(bool distanceFieldText); | 296 void setDistanceFieldTextTEMP(bool distanceFieldText); |
296 | 297 |
297 enum FilterLevel { | 298 enum FilterLevel { |
298 kNone_FilterLevel, | 299 kNone_FilterLevel = kNone_SkFilterQuality, |
299 kLow_FilterLevel, | 300 kLow_FilterLevel = kLow_SkFilterQuality, |
300 kMedium_FilterLevel, | 301 kMedium_FilterLevel = kMedium_SkFilterQuality, |
301 kHigh_FilterLevel | 302 kHigh_FilterLevel = kHigh_SkFilterQuality |
302 }; | 303 }; |
303 | 304 |
304 /** | 305 /** |
305 * Return the filter level. This affects the quality (and performance) of | 306 * Return the filter level. This affects the quality (and performance) of |
306 * drawing scaled images. | 307 * drawing scaled images. |
307 */ | 308 */ |
308 FilterLevel getFilterLevel() const { | 309 FilterLevel getFilterLevel() const { |
309 return (FilterLevel)fBitfields.fFilterLevel; | 310 return (FilterLevel)fBitfields.fFilterLevel; |
310 } | 311 } |
311 | 312 |
312 /** | 313 /** |
313 * Set the filter level. This affects the quality (and performance) of | 314 * Set the filter level. This affects the quality (and performance) of |
314 * drawing scaled images. | 315 * drawing scaled images. |
315 */ | 316 */ |
316 void setFilterLevel(FilterLevel); | 317 void setFilterLevel(FilterLevel); |
317 | 318 |
318 /** | 319 /** |
320 * Set the filter quality. This affects the quality (and performance) of | |
321 * drawing scaled images. | |
322 */ | |
323 void setFilterQuality(SkFilterQuality quality) { | |
scroggo
2015/01/05 16:15:33
Do we need both? (enums and methods)
reed1
2015/01/05 21:58:14
For now we need filterlevel, until we decided to u
scroggo
2015/01/05 22:12:02
Should we go ahead and use a #define to stage?
reed1
2015/01/20 22:23:08
Started too fix all of skia internally, but it is
| |
324 this->setFilterLevel(static_cast<FilterLevel>(quality)); | |
325 } | |
326 | |
327 /** | |
319 * If the predicate is true, set the filterLevel to Low, else set it to | 328 * If the predicate is true, set the filterLevel to Low, else set it to |
320 * None. | 329 * None. |
321 */ | 330 */ |
322 SK_ATTR_DEPRECATED("use setFilterLevel") | 331 SK_ATTR_DEPRECATED("use setFilterLevel") |
323 void setFilterBitmap(bool doFilter) { | 332 void setFilterBitmap(bool doFilter) { |
324 this->setFilterLevel(doFilter ? kLow_FilterLevel : kNone_FilterLevel); | 333 this->setFilterLevel(doFilter ? kLow_FilterLevel : kNone_FilterLevel); |
325 } | 334 } |
326 | 335 |
327 /** | 336 /** |
328 * Returns true if getFilterLevel() returns anything other than None. | 337 * Returns true if getFilterLevel() returns anything other than None. |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1108 friend class GrBitmapTextContext; | 1117 friend class GrBitmapTextContext; |
1109 friend class GrDistanceFieldTextContext; | 1118 friend class GrDistanceFieldTextContext; |
1110 friend class GrStencilAndCoverTextContext; | 1119 friend class GrStencilAndCoverTextContext; |
1111 friend class GrPathRendering; | 1120 friend class GrPathRendering; |
1112 friend class GrGLPathRendering; | 1121 friend class GrGLPathRendering; |
1113 friend class SkTextToPathIter; | 1122 friend class SkTextToPathIter; |
1114 friend class SkCanonicalizePaint; | 1123 friend class SkCanonicalizePaint; |
1115 }; | 1124 }; |
1116 | 1125 |
1117 #endif | 1126 #endif |
OLD | NEW |