OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
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 SkImageFilter_DEFINED | 8 #ifndef SkImageFilter_DEFINED |
9 #define SkImageFilter_DEFINED | 9 #define SkImageFilter_DEFINED |
10 | 10 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 * rect is set at construction time, and determines which pixels from the | 152 * rect is set at construction time, and determines which pixels from the |
153 * input image will be processed. The size of the crop rect should be | 153 * input image will be processed. The size of the crop rect should be |
154 * used as the size of the destination image. The origin of this rect | 154 * used as the size of the destination image. The origin of this rect |
155 * should be used to offset access to the input images, and should also | 155 * should be used to offset access to the input images, and should also |
156 * be added to the "offset" parameter in onFilterImage and | 156 * be added to the "offset" parameter in onFilterImage and |
157 * filterImageGPU(). (The latter ensures that the resulting buffer is | 157 * filterImageGPU(). (The latter ensures that the resulting buffer is |
158 * drawn in the correct location.) | 158 * drawn in the correct location.) |
159 */ | 159 */ |
160 bool cropRectIsSet() const { return fCropRect.flags() != 0x0; } | 160 bool cropRectIsSet() const { return fCropRect.flags() != 0x0; } |
161 | 161 |
| 162 SK_DEFINE_FLATTENABLE_EFFECT_TYPE(SkImageFilter) |
| 163 |
162 protected: | 164 protected: |
163 SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRe
ct = NULL); | 165 SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRe
ct = NULL); |
164 | 166 |
165 // Convenience constructor for 1-input filters. | 167 // Convenience constructor for 1-input filters. |
166 explicit SkImageFilter(SkImageFilter* input, const CropRect* cropRect = NULL
); | 168 explicit SkImageFilter(SkImageFilter* input, const CropRect* cropRect = NULL
); |
167 | 169 |
168 // Convenience constructor for 2-input filters. | 170 // Convenience constructor for 2-input filters. |
169 SkImageFilter(SkImageFilter* input1, SkImageFilter* input2, const CropRect*
cropRect = NULL); | 171 SkImageFilter(SkImageFilter* input1, SkImageFilter* input2, const CropRect*
cropRect = NULL); |
170 | 172 |
171 virtual ~SkImageFilter(); | 173 virtual ~SkImageFilter(); |
(...skipping 14 matching lines...) Expand all Loading... |
186 bool applyCropRect(SkIRect* rect, const SkMatrix& matrix) const; | 188 bool applyCropRect(SkIRect* rect, const SkMatrix& matrix) const; |
187 | 189 |
188 private: | 190 private: |
189 typedef SkFlattenable INHERITED; | 191 typedef SkFlattenable INHERITED; |
190 int fInputCount; | 192 int fInputCount; |
191 SkImageFilter** fInputs; | 193 SkImageFilter** fInputs; |
192 CropRect fCropRect; | 194 CropRect fCropRect; |
193 }; | 195 }; |
194 | 196 |
195 #endif | 197 #endif |
OLD | NEW |