| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The Android Open Source Project | 2 * Copyright 2011 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkBlurImageFilter_DEFINED | 8 #ifndef SkBlurImageFilter_DEFINED |
| 9 #define SkBlurImageFilter_DEFINED | 9 #define SkBlurImageFilter_DEFINED |
| 10 | 10 |
| 11 #include "SkImageFilter.h" | 11 #include "SkImageFilter.h" |
| 12 #include "SkSize.h" | |
| 13 | 12 |
| 14 class SK_API SkBlurImageFilter : public SkImageFilter { | 13 class SK_API SkBlurImageFilter { |
| 15 public: | 14 public: |
| 16 static sk_sp<SkImageFilter> Make(SkScalar sigmaX, SkScalar sigmaY, | 15 static sk_sp<SkImageFilter> Make(SkScalar sigmaX, SkScalar sigmaY, |
| 17 sk_sp<SkImageFilter> input, | 16 sk_sp<SkImageFilter> input, |
| 18 const CropRect* cropRect = nullptr); | 17 const SkImageFilter::CropRect* cropRect = n
ullptr) { |
| 19 | 18 return SkImageFilter::MakeBlur(sigmaX, sigmaY, input, cropRect); |
| 20 SkRect computeFastBounds(const SkRect&) const override; | 19 } |
| 21 | |
| 22 SK_TO_STRING_OVERRIDE() | |
| 23 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter) | |
| 24 | 20 |
| 25 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR | 21 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR |
| 26 static SkImageFilter* Create(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter
* input = nullptr, | 22 static SkImageFilter* Create(SkScalar sigmaX, SkScalar sigmaY, |
| 27 const CropRect* cropRect = nullptr) { | 23 SkImageFilter * input = nullptr, |
| 28 return Make(sigmaX, sigmaY, sk_ref_sp<SkImageFilter>(input), cropRect).r
elease(); | 24 const SkImageFilter::CropRect* cropRect = nullp
tr) { |
| 25 return SkImageFilter::MakeBlur(sigmaX, sigmaY, sk_ref_sp<SkImageFilter>(
input), |
| 26 cropRect).release(); |
| 29 } | 27 } |
| 30 #endif | 28 #endif |
| 31 | |
| 32 protected: | |
| 33 void flatten(SkWriteBuffer&) const override; | |
| 34 sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, | |
| 35 SkIPoint* offset) const override; | |
| 36 SkIRect onFilterNodeBounds(const SkIRect& src, const SkMatrix&, MapDirection
) const override; | |
| 37 | |
| 38 private: | |
| 39 SkBlurImageFilter(SkScalar sigmaX, | |
| 40 SkScalar sigmaY, | |
| 41 sk_sp<SkImageFilter> input, | |
| 42 const CropRect* cropRect); | |
| 43 | |
| 44 SkSize fSigma; | |
| 45 typedef SkImageFilter INHERITED; | |
| 46 }; | 29 }; |
| 47 | 30 |
| 48 #endif | 31 #endif |
| OLD | NEW |