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