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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 /** | 82 /** |
83 * Given the src bounds of an image, this returns the bounds of the result | 83 * Given the src bounds of an image, this returns the bounds of the result |
84 * image after the filter has been applied. | 84 * image after the filter has been applied. |
85 */ | 85 */ |
86 bool filterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect* dst); | 86 bool filterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect* dst); |
87 | 87 |
88 /** | 88 /** |
89 * Returns true if the filter can be processed on the GPU. This is most | 89 * Returns true if the filter can be processed on the GPU. This is most |
90 * often used for multi-pass effects, where intermediate results must be | 90 * often used for multi-pass effects, where intermediate results must be |
91 * rendered to textures. For single-pass effects, use asNewEffect(). | 91 * rendered to textures. For single-pass effects, use asNewEffect(). |
92 * The default implementation returns asNewEffect(NULL, NULL, SkMatrix::I()
). | 92 * The default implementation returns asNewEffect(NULL, NULL, SkMatrix::I()
, |
| 93 * SkIRect()). |
93 */ | 94 */ |
94 virtual bool canFilterImageGPU() const; | 95 virtual bool canFilterImageGPU() const; |
95 | 96 |
96 /** | 97 /** |
97 * Process this image filter on the GPU. This is most often used for | 98 * Process this image filter on the GPU. This is most often used for |
98 * multi-pass effects, where intermediate results must be rendered to | 99 * multi-pass effects, where intermediate results must be rendered to |
99 * textures. For single-pass effects, use asNewEffect(). src is the | 100 * textures. For single-pass effects, use asNewEffect(). src is the |
100 * source image for processing, as a texture-backed bitmap. result is | 101 * source image for processing, as a texture-backed bitmap. result is |
101 * the destination bitmap, which should contain a texture-backed pixelref | 102 * the destination bitmap, which should contain a texture-backed pixelref |
102 * on success. offset is the amount to translate the resulting image | 103 * on success. offset is the amount to translate the resulting image |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 * If effect is non-NULL, a new GrEffect instance is stored | 177 * If effect is non-NULL, a new GrEffect instance is stored |
177 * in it. The caller assumes ownership of the stage, and it is up to the | 178 * in it. The caller assumes ownership of the stage, and it is up to the |
178 * caller to unref it. | 179 * caller to unref it. |
179 * | 180 * |
180 * The effect can assume its vertexCoords space maps 1-to-1 with texels | 181 * The effect can assume its vertexCoords space maps 1-to-1 with texels |
181 * in the texture. "matrix" is a transformation to apply to filter | 182 * in the texture. "matrix" is a transformation to apply to filter |
182 * parameters before they are used in the effect. Note that this function | 183 * parameters before they are used in the effect. Note that this function |
183 * will be called with (NULL, NULL, SkMatrix::I()) to query for support, | 184 * will be called with (NULL, NULL, SkMatrix::I()) to query for support, |
184 * so returning "true" indicates support for all possible matrices. | 185 * so returning "true" indicates support for all possible matrices. |
185 */ | 186 */ |
186 virtual bool asNewEffect(GrEffectRef** effect, GrTexture*, const SkMatrix& m
atrix) const; | 187 virtual bool asNewEffect(GrEffectRef** effect, |
| 188 GrTexture*, |
| 189 const SkMatrix& matrix, |
| 190 const SkIRect& bounds) const; |
187 | 191 |
188 private: | 192 private: |
189 typedef SkFlattenable INHERITED; | 193 typedef SkFlattenable INHERITED; |
190 int fInputCount; | 194 int fInputCount; |
191 SkImageFilter** fInputs; | 195 SkImageFilter** fInputs; |
192 CropRect fCropRect; | 196 CropRect fCropRect; |
193 }; | 197 }; |
194 | 198 |
195 #endif | 199 #endif |
OLD | NEW |