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" | 12 #include "SkSize.h" |
13 | 13 |
14 class SK_API SkBlurImageFilter : public SkImageFilter { | 14 class SK_API SkBlurImageFilter : public SkImageFilter { |
15 public: | 15 public: |
16 static sk_sp<SkImageFilter> Make(SkScalar sigmaX, SkScalar sigmaY, sk_sp<SkI
mageFilter> input, | 16 static sk_sp<SkImageFilter> Make(SkScalar sigmaX, SkScalar sigmaY, |
17 const CropRect* cropRect = nullptr) { | 17 sk_sp<SkImageFilter> input, |
18 if (0 == sigmaX && 0 == sigmaY && nullptr == cropRect) { | 18 const CropRect* cropRect = nullptr); |
19 return input; | |
20 } | |
21 return sk_sp<SkImageFilter>(new SkBlurImageFilter(sigmaX, sigmaY, input,
cropRect)); | |
22 } | |
23 | 19 |
24 SkRect computeFastBounds(const SkRect&) const override; | 20 SkRect computeFastBounds(const SkRect&) const override; |
25 | 21 |
26 SK_TO_STRING_OVERRIDE() | 22 SK_TO_STRING_OVERRIDE() |
27 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter) | 23 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter) |
28 | 24 |
29 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR | 25 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR |
30 static SkImageFilter* Create(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter
* input = nullptr, | 26 static SkImageFilter* Create(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter
* input = nullptr, |
31 const CropRect* cropRect = nullptr) { | 27 const CropRect* cropRect = nullptr) { |
32 return Make(sigmaX, sigmaY, sk_ref_sp<SkImageFilter>(input), cropRect).r
elease(); | 28 return Make(sigmaX, sigmaY, sk_ref_sp<SkImageFilter>(input), cropRect).r
elease(); |
(...skipping 10 matching lines...) Expand all Loading... |
43 SkBlurImageFilter(SkScalar sigmaX, | 39 SkBlurImageFilter(SkScalar sigmaX, |
44 SkScalar sigmaY, | 40 SkScalar sigmaY, |
45 sk_sp<SkImageFilter> input, | 41 sk_sp<SkImageFilter> input, |
46 const CropRect* cropRect); | 42 const CropRect* cropRect); |
47 | 43 |
48 SkSize fSigma; | 44 SkSize fSigma; |
49 typedef SkImageFilter INHERITED; | 45 typedef SkImageFilter INHERITED; |
50 }; | 46 }; |
51 | 47 |
52 #endif | 48 #endif |
OLD | NEW |