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 SkImageFilter* Create(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter
* input = NULL, | 16 static SkImageFilter* Create(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter
* input = NULL, |
17 const CropRect* cropRect = NULL) { | 17 const CropRect* cropRect = NULL) { |
18 return new SkBlurImageFilter(sigmaX, sigmaY, input, cropRect); | 18 return new SkBlurImageFilter(sigmaX, sigmaY, input, cropRect); |
19 } | 19 } |
20 | 20 |
21 void computeFastBounds(const SkRect&, SkRect*) const override; | 21 void computeFastBounds(const SkRect&, SkRect*) const override; |
22 | 22 |
23 SK_TO_STRING_OVERRIDE() | 23 SK_TO_STRING_OVERRIDE() |
24 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter) | 24 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter) |
25 | 25 |
26 protected: | 26 protected: |
27 void flatten(SkWriteBuffer&) const override; | 27 void flatten(SkWriteBuffer&) const override; |
28 bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* re
sult, | 28 bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* re
sult, |
29 SkIPoint* offset) const override; | 29 SkIPoint* offset) const override; |
30 bool onFilterBounds(const SkIRect& src, const SkMatrix&, SkIRect* dst) const
override; | 30 void onFilterNodeBounds(const SkIRect& src, const SkMatrix&, |
| 31 SkIRect* dst, MapDirection) const override; |
31 bool canFilterImageGPU() const override { return true; } | 32 bool canFilterImageGPU() const override { return true; } |
32 bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, S
kBitmap* result, | 33 bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, S
kBitmap* result, |
33 SkIPoint* offset) const override; | 34 SkIPoint* offset) const override; |
34 | 35 |
35 private: | 36 private: |
36 SkBlurImageFilter(SkScalar sigmaX, | 37 SkBlurImageFilter(SkScalar sigmaX, |
37 SkScalar sigmaY, | 38 SkScalar sigmaY, |
38 SkImageFilter* input, | 39 SkImageFilter* input, |
39 const CropRect* cropRect); | 40 const CropRect* cropRect); |
40 | 41 |
41 SkSize fSigma; | 42 SkSize fSigma; |
42 typedef SkImageFilter INHERITED; | 43 typedef SkImageFilter INHERITED; |
43 }; | 44 }; |
44 | 45 |
45 #endif | 46 #endif |
OLD | NEW |