aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar vjiaoblack <vjiaoblack@google.com>2016-08-22 12:00:25 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-22 12:00:25 -0700
commit4d760175686df8f61a11b66946eb307d89dd2c75 (patch)
tree5ff38cd20fa4483e6567f3889173adfbdf5680b5 /include
parent3a0c3696f0ece5e408baf9d1ed14251ba7a223e3 (diff)
Moving SkBlurImageFilter into core
Diffstat (limited to 'include')
-rw-r--r--include/core/SkImageFilter.h5
-rw-r--r--include/effects/SkBlurImageFilter.h32
2 files changed, 8 insertions, 29 deletions
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index 6210073bf4..97f84dc596 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -152,6 +152,10 @@ public:
return this->isColorFilterNode(filterPtr);
}
+ static sk_sp<SkImageFilter> MakeBlur(SkScalar sigmaX, SkScalar sigmaY,
+ sk_sp<SkImageFilter> input,
+ const CropRect* cropRect = nullptr);
+
/**
* Returns true (and optionally returns a ref'd filter) if this imagefilter can be completely
* replaced by the returned colorfilter. i.e. the two effects will affect drawing in the
@@ -229,6 +233,7 @@ public:
SK_TO_STRING_PUREVIRT()
SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter)
+ SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
protected:
class Common {
diff --git a/include/effects/SkBlurImageFilter.h b/include/effects/SkBlurImageFilter.h
index 9bfa19b875..085a13b5b3 100644
--- a/include/effects/SkBlurImageFilter.h
+++ b/include/effects/SkBlurImageFilter.h
@@ -9,40 +9,14 @@
#define SkBlurImageFilter_DEFINED
#include "SkImageFilter.h"
-#include "SkSize.h"
-class SK_API SkBlurImageFilter : public SkImageFilter {
+class SK_API SkBlurImageFilter {
public:
static sk_sp<SkImageFilter> Make(SkScalar sigmaX, SkScalar sigmaY,
sk_sp<SkImageFilter> input,
- const CropRect* cropRect = nullptr);
-
- SkRect computeFastBounds(const SkRect&) const override;
-
- SK_TO_STRING_OVERRIDE()
- SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter)
-
-#ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
- static SkImageFilter* Create(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter* input = nullptr,
- const CropRect* cropRect = nullptr) {
- return Make(sigmaX, sigmaY, sk_ref_sp<SkImageFilter>(input), cropRect).release();
+ const SkImageFilter::CropRect* cropRect = nullptr) {
+ return SkImageFilter::MakeBlur(sigmaX, sigmaY, input, cropRect);
}
-#endif
-
-protected:
- void flatten(SkWriteBuffer&) const override;
- sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
- SkIPoint* offset) const override;
- SkIRect onFilterNodeBounds(const SkIRect& src, const SkMatrix&, MapDirection) const override;
-
-private:
- SkBlurImageFilter(SkScalar sigmaX,
- SkScalar sigmaY,
- sk_sp<SkImageFilter> input,
- const CropRect* cropRect);
-
- SkSize fSigma;
- typedef SkImageFilter INHERITED;
};
#endif