Index: include/core/SkPaint.h |
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h |
index 2d7b3fa542817e4fdc28652113a6ddf4c83f8086..949b5a71d04120915e8b8b70f3abc2c22e65cd48 100644 |
--- a/include/core/SkPaint.h |
+++ b/include/core/SkPaint.h |
@@ -98,6 +98,7 @@ public: |
*/ |
enum Flags { |
kAntiAlias_Flag = 0x01, //!< mask to enable antialiasing |
+ // DEPRECATED -- use setFilterLevel instead |
kFilterBitmap_Flag = 0x02, //!< mask to enable bitmap filtering |
kDither_Flag = 0x04, //!< mask to enable dithering |
bsalomon
2013/07/18 13:42:12
maybe put a newline here.. just so it's obvious th
|
kUnderlineText_Flag = 0x08, //!< mask to enable underline text |
@@ -111,7 +112,10 @@ public: |
kAutoHinting_Flag = 0x800, //!< mask to force Freetype's autohinter |
kVerticalText_Flag = 0x1000, |
kGenA8FromLCD_Flag = 0x2000, // hack for GDI -- do not use if you can help it |
+ |
+ // DEPRECATED -- use setFilterLevel instead |
kHighQualityFilterBitmap_Flag = 0x4000, // temporary flag |
+ // DEPRECATED -- use setFilterLevel instead |
kHighQualityDownsampleBitmap_Flag = 0x8000, // temporary flag |
// when adding extra flags, note that the fFlags member is specified |
@@ -280,11 +284,41 @@ public: |
*/ |
void setDevKernText(bool devKernText); |
- bool isFilterBitmap() const { |
- return SkToBool(this->getFlags() & kFilterBitmap_Flag); |
+ enum FilterLevel { |
+ kNone_FilterLevel, |
+ kLow_FilterLevel, |
+ kMedium_FilterLevel, |
+ kHigh_FilterLevel |
+ }; |
+ |
+ /** |
+ * Return the filter level. This affects the quality (and performance) of |
+ * drawing scaled images. |
+ */ |
+ FilterLevel getFilterLevel() const; |
+ |
+ /** |
+ * Set the filter level. This affects the quality (and performance) of |
+ * drawing scaled images. |
+ */ |
+ void setFilterLevel(FilterLevel); |
+ |
+ /** |
+ * DEPRECATED: use setFilterLevel instead. |
+ * If the predicate is true, set the filterLevel to Low, else set it to |
+ * None. |
+ */ |
+ void setFilterBitmap(bool doFilter) { |
+ this->setFilterLevel(doFilter ? kLow_FilterLevel : kNone_FilterLevel); |
} |
- void setFilterBitmap(bool filterBitmap); |
+ /** |
+ * DEPRECATED: call getFilterLevel() instead. |
+ * Returns true if getFilterLevel() returns anything other than None. |
+ */ |
+ bool isFilterBitmap() const { |
+ return kNone_FilterLevel != this->getFilterLevel(); |
+ } |
/** Styles apply to rect, oval, path, and text. |
Bitmaps are always drawn in "fill", and lines are always drawn in |