OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 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 SkMatrixConvolutionImageFilter_DEFINED | 8 #ifndef SkMatrixConvolutionImageFilter_DEFINED |
9 #define SkMatrixConvolutionImageFilter_DEFINED | 9 #define SkMatrixConvolutionImageFilter_DEFINED |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 SkImageFilter* input = NULL, | 61 SkImageFilter* input = NULL, |
62 const CropRect* cropRect = NUL
L) { | 62 const CropRect* cropRect = NUL
L) { |
63 return SkNEW_ARGS(SkMatrixConvolutionImageFilter, (kernelSize, kernel, g
ain, bias, | 63 return SkNEW_ARGS(SkMatrixConvolutionImageFilter, (kernelSize, kernel, g
ain, bias, |
64 kernelOffset, tileMod
e, convolveAlpha, | 64 kernelOffset, tileMod
e, convolveAlpha, |
65 input, cropRect)); | 65 input, cropRect)); |
66 } | 66 } |
67 | 67 |
68 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMatrixConvolutionImage
Filter) | 68 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMatrixConvolutionImage
Filter) |
69 | 69 |
70 protected: | 70 protected: |
71 SkMatrixConvolutionImageFilter(SkReadBuffer& buffer); | 71 SkMatrixConvolutionImageFilter(const SkISize& kernelSize, |
| 72 const SkScalar* kernel, |
| 73 SkScalar gain, |
| 74 SkScalar bias, |
| 75 const SkIPoint& kernelOffset, |
| 76 TileMode tileMode, |
| 77 bool convolveAlpha, |
| 78 SkImageFilter* input, |
| 79 const CropRect* cropRect); |
| 80 explicit SkMatrixConvolutionImageFilter(SkReadBuffer& buffer); |
72 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 81 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
73 | 82 |
74 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 83 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
75 SkBitmap* result, SkIPoint* loc) const SK_OVERRID
E; | 84 SkBitmap* result, SkIPoint* loc) const SK_OVERRID
E; |
76 virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const
SK_OVERRIDE; | 85 virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const
SK_OVERRIDE; |
77 | 86 |
78 | 87 |
79 #if SK_SUPPORT_GPU | 88 #if SK_SUPPORT_GPU |
80 virtual bool asNewEffect(GrEffectRef** effect, | 89 virtual bool asNewEffect(GrEffectRef** effect, |
81 GrTexture*, | 90 GrTexture*, |
82 const SkMatrix& ctm, | 91 const SkMatrix& ctm, |
83 const SkIRect& bounds) const SK_OVERRIDE; | 92 const SkIRect& bounds) const SK_OVERRIDE; |
84 #endif | 93 #endif |
85 | 94 |
86 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS | |
87 public: | |
88 #endif | |
89 SkMatrixConvolutionImageFilter(const SkISize& kernelSize, | |
90 const SkScalar* kernel, | |
91 SkScalar gain, | |
92 SkScalar bias, | |
93 const SkIPoint& kernelOffset, | |
94 TileMode tileMode, | |
95 bool convolveAlpha, | |
96 SkImageFilter* input = NULL, | |
97 const CropRect* cropRect = NULL); | |
98 | |
99 private: | 95 private: |
100 SkISize fKernelSize; | 96 SkISize fKernelSize; |
101 SkScalar* fKernel; | 97 SkScalar* fKernel; |
102 SkScalar fGain; | 98 SkScalar fGain; |
103 SkScalar fBias; | 99 SkScalar fBias; |
104 SkIPoint fKernelOffset; | 100 SkIPoint fKernelOffset; |
105 TileMode fTileMode; | 101 TileMode fTileMode; |
106 bool fConvolveAlpha; | 102 bool fConvolveAlpha; |
107 typedef SkImageFilter INHERITED; | 103 typedef SkImageFilter INHERITED; |
108 | 104 |
(...skipping 11 matching lines...) Expand all Loading... |
120 SkBitmap* result, | 116 SkBitmap* result, |
121 const SkIRect& rect, | 117 const SkIRect& rect, |
122 const SkIRect& bounds) const; | 118 const SkIRect& bounds) const; |
123 void filterBorderPixels(const SkBitmap& src, | 119 void filterBorderPixels(const SkBitmap& src, |
124 SkBitmap* result, | 120 SkBitmap* result, |
125 const SkIRect& rect, | 121 const SkIRect& rect, |
126 const SkIRect& bounds) const; | 122 const SkIRect& bounds) const; |
127 }; | 123 }; |
128 | 124 |
129 #endif | 125 #endif |
OLD | NEW |