add newImage API
BUG=skia:3277
related bug: skbug.com/3276
Review URL: https://codereview.chromium.org/821083002
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index 68220f6..fef4319 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -10,9 +10,13 @@
#include "SkColor.h"
#include "SkDrawLooper.h"
+#include "SkFilterQuality.h"
#include "SkMatrix.h"
#include "SkXfermode.h"
+// TODO: clean up Skia internals so we can remove this and only keep it for clients
+#define SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM
+
class SkAnnotation;
class SkAutoGlyphCache;
class SkColorFilter;
@@ -294,11 +298,12 @@
*/
void setDistanceFieldTextTEMP(bool distanceFieldText);
+#ifdef SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM
enum FilterLevel {
- kNone_FilterLevel,
- kLow_FilterLevel,
- kMedium_FilterLevel,
- kHigh_FilterLevel
+ kNone_FilterLevel = kNone_SkFilterQuality,
+ kLow_FilterLevel = kLow_SkFilterQuality,
+ kMedium_FilterLevel = kMedium_SkFilterQuality,
+ kHigh_FilterLevel = kHigh_SkFilterQuality
};
/**
@@ -306,14 +311,31 @@
* drawing scaled images.
*/
FilterLevel getFilterLevel() const {
- return (FilterLevel)fBitfields.fFilterLevel;
+ return (FilterLevel)this->getFilterQuality();
}
/**
* Set the filter level. This affects the quality (and performance) of
* drawing scaled images.
*/
- void setFilterLevel(FilterLevel);
+ void setFilterLevel(FilterLevel level) {
+ this->setFilterQuality((SkFilterQuality)level);
+ }
+#endif
+
+ /**
+ * Return the filter level. This affects the quality (and performance) of
+ * drawing scaled images.
+ */
+ SkFilterQuality getFilterQuality() const {
+ return (SkFilterQuality)fBitfields.fFilterQuality;
+ }
+
+ /**
+ * Set the filter quality. This affects the quality (and performance) of
+ * drawing scaled images.
+ */
+ void setFilterQuality(SkFilterQuality quality);
/**
* If the predicate is true, set the filterLevel to Low, else set it to
@@ -1040,7 +1062,7 @@
unsigned fStyle : 2;
unsigned fTextEncoding : 2; // 3 values
unsigned fHinting : 2;
- unsigned fFilterLevel : 2;
+ unsigned fFilterQuality : 2;
//unsigned fFreeBits : 2;
} fBitfields;
uint32_t fBitfieldsUInt;