Index: src/core/SkPaint.cpp |
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp |
index 886794c479702e18a9c7cc3c0de2df6c69f3ae38..372e68051e76b90b62c0d9c1598cfd30d7ee882c 100644 |
--- a/src/core/SkPaint.cpp |
+++ b/src/core/SkPaint.cpp |
@@ -205,6 +205,29 @@ void SkPaint::setPaintOptionsAndroid(const SkPaintOptionsAndroid& options) { |
} |
#endif |
+SkPaint::FilterLevel SkPaint::getFilterLevel() const { |
+ int level = 0; |
+ if (fFlags & kFilterBitmap_Flag) { |
+ level |= 1; |
+ } |
+ if (fFlags & kHighQualityFilterBitmap_Flag) { |
+ level |= 2; |
+ } |
+ return (FilterLevel)level; |
+} |
+ |
+void SkPaint::setFilterLevel(FilterLevel level) { |
+ unsigned mask = kFilterBitmap_Flag | kHighQualityFilterBitmap_Flag; |
+ unsigned flags = 0; |
+ if (level & 1) { |
+ flags |= kFilterBitmap_Flag; |
+ } |
+ if (level & 2) { |
+ flags |= kHighQualityFilterBitmap_Flag; |
+ } |
+ this->setFlags((fFlags & ~mask) | flags); |
+} |
+ |
void SkPaint::setHinting(Hinting hintingLevel) { |
GEN_ID_INC_EVAL((unsigned) hintingLevel != fHinting); |
fHinting = hintingLevel; |
@@ -263,10 +286,6 @@ void SkPaint::setDevKernText(bool doDevKern) { |
this->setFlags(SkSetClearMask(fFlags, doDevKern, kDevKernText_Flag)); |
} |
-void SkPaint::setFilterBitmap(bool doFilter) { |
- this->setFlags(SkSetClearMask(fFlags, doFilter, kFilterBitmap_Flag)); |
-} |
- |
void SkPaint::setStyle(Style style) { |
if ((unsigned)style < kStyleCount) { |
GEN_ID_INC_EVAL((unsigned)style != fStyle); |