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 SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter) |
| 147 |
146 protected: | 148 protected: |
147 SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRe
ct = NULL); | 149 SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRe
ct = NULL); |
148 | 150 |
149 // Convenience constructor for 1-input filters. | 151 // Convenience constructor for 1-input filters. |
150 explicit SkImageFilter(SkImageFilter* input, const CropRect* cropRect = NULL
); | 152 explicit SkImageFilter(SkImageFilter* input, const CropRect* cropRect = NULL
); |
151 | 153 |
152 // Convenience constructor for 2-input filters. | 154 // Convenience constructor for 2-input filters. |
153 SkImageFilter(SkImageFilter* input1, SkImageFilter* input2, const CropRect*
cropRect = NULL); | 155 SkImageFilter(SkImageFilter* input1, SkImageFilter* input2, const CropRect*
cropRect = NULL); |
154 | 156 |
155 virtual ~SkImageFilter(); | 157 virtual ~SkImageFilter(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 const SkIRect& bounds) const; | 192 const SkIRect& bounds) const; |
191 | 193 |
192 private: | 194 private: |
193 typedef SkFlattenable INHERITED; | 195 typedef SkFlattenable INHERITED; |
194 int fInputCount; | 196 int fInputCount; |
195 SkImageFilter** fInputs; | 197 SkImageFilter** fInputs; |
196 CropRect fCropRect; | 198 CropRect fCropRect; |
197 }; | 199 }; |
198 | 200 |
199 #endif | 201 #endif |
OLD | NEW |