aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-03-16 10:08:34 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-16 10:08:34 -0700
commit93a1215fe0ab007ce941c721f1fd3e9dcb5d4754 (patch)
treed6dfbb67e08a7f3163008787a10c1ec9b492e291 /include
parent903dcb08b146cbaf81420a734a64692038b467ca (diff)
SkPaint::FilterLevel -> SkFilterQuality
clone (+rebase) of https://codereview.chromium.org/1009183002/ BUG=skia: TBR=scroggo@google.com Review URL: https://codereview.chromium.org/1014533004
Diffstat (limited to 'include')
-rw-r--r--include/core/SkPaint.h3
-rw-r--r--include/effects/SkMatrixImageFilter.h14
-rw-r--r--include/effects/SkPictureImageFilter.h19
3 files changed, 24 insertions, 12 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index 31090c8f6a..79821e5769 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -14,9 +14,6 @@
#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;
diff --git a/include/effects/SkMatrixImageFilter.h b/include/effects/SkMatrixImageFilter.h
index 7d855b777f..d0afdc3bd9 100644
--- a/include/effects/SkMatrixImageFilter.h
+++ b/include/effects/SkMatrixImageFilter.h
@@ -29,9 +29,17 @@ public:
*/
static SkMatrixImageFilter* Create(const SkMatrix& transform,
- SkPaint::FilterLevel,
+ SkFilterQuality,
SkImageFilter* input = NULL,
uint32_t uniqueID = 0);
+#ifdef SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM
+ static SkMatrixImageFilter* Create(const SkMatrix& transform,
+ SkPaint::FilterLevel level,
+ SkImageFilter* input = NULL,
+ uint32_t uniqueID = 0) {
+ return Create(transform, SkFilterQuality(level), input, uniqueID);
+ }
+#endif
virtual ~SkMatrixImageFilter();
void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE;
@@ -41,7 +49,7 @@ public:
protected:
SkMatrixImageFilter(const SkMatrix& transform,
- SkPaint::FilterLevel,
+ SkFilterQuality,
SkImageFilter* input,
uint32_t uniqueID);
void flatten(SkWriteBuffer&) const SK_OVERRIDE;
@@ -53,7 +61,7 @@ protected:
private:
SkMatrix fTransform;
- SkPaint::FilterLevel fFilterLevel;
+ SkFilterQuality fFilterQuality;
typedef SkImageFilter INHERITED;
};
diff --git a/include/effects/SkPictureImageFilter.h b/include/effects/SkPictureImageFilter.h
index e6579eabe7..332663f730 100644
--- a/include/effects/SkPictureImageFilter.h
+++ b/include/effects/SkPictureImageFilter.h
@@ -28,7 +28,7 @@ public:
uint32_t uniqueID = 0) {
return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, uniqueID,
kDeviceSpace_PictureResolution,
- SkPaint::kLow_FilterLevel));
+ kLow_SkFilterQuality));
}
/**
@@ -40,12 +40,19 @@ public:
*/
static SkPictureImageFilter* CreateForLocalSpace(const SkPicture* picture,
const SkRect& cropRect,
- SkPaint::FilterLevel filterLevel,
+ SkFilterQuality filterQuality,
uint32_t uniqueID = 0) {
return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, uniqueID,
- kLocalSpace_PictureResolution, filterLevel));
+ kLocalSpace_PictureResolution, filterQuality));
}
-
+#ifdef SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM
+ static SkPictureImageFilter* CreateForLocalSpace(const SkPicture* picture,
+ const SkRect& cropRect,
+ SkPaint::FilterLevel filterLevel,
+ uint32_t uniqueID = 0) {
+ return CreateForLocalSpace(picture, cropRect, (SkFilterQuality)filterLevel, uniqueID);
+ }
+#endif
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter)
@@ -57,7 +64,7 @@ protected:
explicit SkPictureImageFilter(const SkPicture* picture, uint32_t uniqueID);
SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect, uint32_t uniqueID,
- PictureResolution, SkPaint::FilterLevel);
+ PictureResolution, SkFilterQuality);
virtual ~SkPictureImageFilter();
/* Constructs an SkPictureImageFilter object from an SkReadBuffer.
* Note: If the SkPictureImageFilter object construction requires bitmap
@@ -80,7 +87,7 @@ private:
const SkPicture* fPicture;
SkRect fCropRect;
PictureResolution fPictureResolution;
- SkPaint::FilterLevel fFilterLevel;
+ SkFilterQuality fFilterQuality;
typedef SkImageFilter INHERITED;
};