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