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 |
11 #include "SkFlattenable.h" | 11 #include "SkFlattenable.h" |
12 #include "SkMatrix.h" | 12 #include "SkMatrix.h" |
13 #include "SkRect.h" | 13 #include "SkRect.h" |
14 | 14 |
15 class SkBitmap; | 15 class SkBitmap; |
16 class SkColorFilter; | 16 class SkColorFilter; |
17 class SkBaseDevice; | 17 class SkBaseDevice; |
18 struct SkIPoint; | 18 struct SkIPoint; |
19 class GrEffectRef; | 19 class GrEffect; |
20 class GrTexture; | 20 class GrTexture; |
21 | 21 |
22 /** | 22 /** |
23 * Base class for image filters. If one is installed in the paint, then | 23 * Base class for image filters. If one is installed in the paint, then |
24 * all drawing occurs as usual, but it is as if the drawing happened into an | 24 * all drawing occurs as usual, but it is as if the drawing happened into an |
25 * offscreen (before the xfermode is applied). This offscreen bitmap will | 25 * offscreen (before the xfermode is applied). This offscreen bitmap will |
26 * then be handed to the imagefilter, who in turn creates a new bitmap which | 26 * then be handed to the imagefilter, who in turn creates a new bitmap which |
27 * is what will finally be drawn to the device (using the original xfermode). | 27 * is what will finally be drawn to the device (using the original xfermode). |
28 */ | 28 */ |
29 class SK_API SkImageFilter : public SkFlattenable { | 29 class SK_API SkImageFilter : public SkFlattenable { |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 * If effect is non-NULL, a new GrEffect instance is stored | 274 * If effect is non-NULL, a new GrEffect instance is stored |
275 * in it. The caller assumes ownership of the stage, and it is up to the | 275 * in it. The caller assumes ownership of the stage, and it is up to the |
276 * caller to unref it. | 276 * caller to unref it. |
277 * | 277 * |
278 * The effect can assume its vertexCoords space maps 1-to-1 with texels | 278 * The effect can assume its vertexCoords space maps 1-to-1 with texels |
279 * in the texture. "matrix" is a transformation to apply to filter | 279 * in the texture. "matrix" is a transformation to apply to filter |
280 * parameters before they are used in the effect. Note that this function | 280 * parameters before they are used in the effect. Note that this function |
281 * will be called with (NULL, NULL, SkMatrix::I()) to query for support, | 281 * will be called with (NULL, NULL, SkMatrix::I()) to query for support, |
282 * so returning "true" indicates support for all possible matrices. | 282 * so returning "true" indicates support for all possible matrices. |
283 */ | 283 */ |
284 virtual bool asNewEffect(GrEffectRef** effect, | 284 virtual bool asNewEffect(GrEffect** effect, |
285 GrTexture*, | 285 GrTexture*, |
286 const SkMatrix& matrix, | 286 const SkMatrix& matrix, |
287 const SkIRect& bounds) const; | 287 const SkIRect& bounds) const; |
288 | 288 |
289 private: | 289 private: |
290 typedef SkFlattenable INHERITED; | 290 typedef SkFlattenable INHERITED; |
291 int fInputCount; | 291 int fInputCount; |
292 SkImageFilter** fInputs; | 292 SkImageFilter** fInputs; |
293 CropRect fCropRect; | 293 CropRect fCropRect; |
294 }; | 294 }; |
295 | 295 |
296 #endif | 296 #endif |
OLD | NEW |