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 SkBlurImageFilter* Create(SkScalar sigmaX, |
17 SkScalar sigmaY, | 17 SkScalar sigmaY, |
18 SkImageFilter* input = NULL, | 18 SkImageFilter* input = NULL, |
19 const CropRect* cropRect = NULL) { | 19 const CropRect* cropRect = NULL) { |
20 return SkNEW_ARGS(SkBlurImageFilter, (sigmaX, sigmaY, input, cropRect)); | 20 return SkNEW_ARGS(SkBlurImageFilter, (sigmaX, sigmaY, input, cropRect)); |
21 } | 21 } |
22 | 22 |
23 virtual void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE; | 23 virtual void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE; |
24 | 24 |
25 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter) | 25 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter) |
26 | 26 |
27 protected: | 27 protected: |
| 28 SkBlurImageFilter(SkScalar sigmaX, |
| 29 SkScalar sigmaY, |
| 30 SkImageFilter* input, |
| 31 const CropRect* cropRect); |
28 explicit SkBlurImageFilter(SkReadBuffer& buffer); | 32 explicit SkBlurImageFilter(SkReadBuffer& buffer); |
29 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 33 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
30 | 34 |
31 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 35 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
32 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE; | 36 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE; |
33 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, | 37 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, |
34 SkIRect* dst) const SK_OVERRIDE; | 38 SkIRect* dst) const SK_OVERRIDE; |
35 | 39 |
36 bool canFilterImageGPU() const SK_OVERRIDE { return true; } | 40 bool canFilterImageGPU() const SK_OVERRIDE { return true; } |
37 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context
& ctx, | 41 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context
& ctx, |
38 SkBitmap* result, SkIPoint* offset) const SK_OVE
RRIDE; | 42 SkBitmap* result, SkIPoint* offset) const SK_OVE
RRIDE; |
39 | 43 |
40 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS | |
41 public: | |
42 #endif | |
43 SkBlurImageFilter(SkScalar sigmaX, | |
44 SkScalar sigmaY, | |
45 SkImageFilter* input = NULL, | |
46 const CropRect* cropRect = NULL); | |
47 | |
48 private: | 44 private: |
49 SkSize fSigma; | 45 SkSize fSigma; |
50 typedef SkImageFilter INHERITED; | 46 typedef SkImageFilter INHERITED; |
51 }; | 47 }; |
52 | 48 |
53 #endif | 49 #endif |
OLD | NEW |