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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 * rect is set at construction time, and determines which pixels from the | 136 * rect is set at construction time, and determines which pixels from the |
137 * input image will be processed. The size of the crop rect should be | 137 * input image will be processed. The size of the crop rect should be |
138 * used as the size of the destination image. The origin of this rect | 138 * used as the size of the destination image. The origin of this rect |
139 * should be used to offset access to the input images, and should also | 139 * should be used to offset access to the input images, and should also |
140 * be added to the "offset" parameter in onFilterImage and | 140 * be added to the "offset" parameter in onFilterImage and |
141 * filterImageGPU(). (The latter ensures that the resulting buffer is | 141 * filterImageGPU(). (The latter ensures that the resulting buffer is |
142 * drawn in the correct location.) | 142 * drawn in the correct location.) |
143 */ | 143 */ |
144 bool cropRectIsSet() const { return fCropRect.flags() != 0x0; } | 144 bool cropRectIsSet() const { return fCropRect.flags() != 0x0; } |
145 | 145 |
| 146 // Default impl returns union of all input bounds. |
| 147 virtual void computeFastBounds(const SkRect&, SkRect*) const; |
| 148 |
146 SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter) | 149 SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter) |
147 | 150 |
148 protected: | 151 protected: |
149 SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRe
ct = NULL); | 152 SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRe
ct = NULL); |
150 | 153 |
151 // Convenience constructor for 1-input filters. | 154 // Convenience constructor for 1-input filters. |
152 explicit SkImageFilter(SkImageFilter* input, const CropRect* cropRect = NULL
); | 155 explicit SkImageFilter(SkImageFilter* input, const CropRect* cropRect = NULL
); |
153 | 156 |
154 // Convenience constructor for 2-input filters. | 157 // Convenience constructor for 2-input filters. |
155 SkImageFilter(SkImageFilter* input1, SkImageFilter* input2, const CropRect*
cropRect = NULL); | 158 SkImageFilter(SkImageFilter* input1, SkImageFilter* input2, const CropRect*
cropRect = NULL); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 const SkIRect& bounds) const; | 217 const SkIRect& bounds) const; |
215 | 218 |
216 private: | 219 private: |
217 typedef SkFlattenable INHERITED; | 220 typedef SkFlattenable INHERITED; |
218 int fInputCount; | 221 int fInputCount; |
219 SkImageFilter** fInputs; | 222 SkImageFilter** fInputs; |
220 CropRect fCropRect; | 223 CropRect fCropRect; |
221 }; | 224 }; |
222 | 225 |
223 #endif | 226 #endif |
OLD | NEW |