Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(636)

Unified Diff: include/core/SkPaint.h

Issue 821083002: add newImage API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: check when subset == bounds Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkImage.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPaint.h
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index 68220f65c9c25519b1884c155adc8f632478cf4b..fef4319477ed183dc4c8772cf6bebd45e39b4610 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 @@ public:
*/
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 @@ public:
* 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 @@ private:
unsigned fStyle : 2;
unsigned fTextEncoding : 2; // 3 values
unsigned fHinting : 2;
- unsigned fFilterLevel : 2;
+ unsigned fFilterQuality : 2;
//unsigned fFreeBits : 2;
} fBitfields;
uint32_t fBitfieldsUInt;
« no previous file with comments | « include/core/SkImage.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698