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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 * The default implementation returns asNewEffect(NULL, NULL). | 102 * The default implementation returns asNewEffect(NULL, NULL). |
103 */ | 103 */ |
104 virtual bool canFilterImageGPU() const; | 104 virtual bool canFilterImageGPU() const; |
105 | 105 |
106 /** | 106 /** |
107 * Process this image filter on the GPU. This is most often used for | 107 * Process this image filter on the GPU. This is most often used for |
108 * multi-pass effects, where intermediate results must be rendered to | 108 * multi-pass effects, where intermediate results must be rendered to |
109 * textures. For single-pass effects, use asNewEffect(). src is the | 109 * textures. For single-pass effects, use asNewEffect(). src is the |
110 * source image for processing, as a texture-backed bitmap. result is | 110 * source image for processing, as a texture-backed bitmap. result is |
111 * the destination bitmap, which should contain a texture-backed pixelref | 111 * the destination bitmap, which should contain a texture-backed pixelref |
112 * on success. The default implementation does single-pass processing | 112 * on success. offset is the amount to translate the resulting image |
113 * using asNewEffect(). | 113 * relative to the src when it is drawn. The default implementation does |
| 114 * single-pass processing using asNewEffect(). |
114 */ | 115 */ |
115 virtual bool filterImageGPU(Proxy*, const SkBitmap& src, SkBitmap* result); | 116 virtual bool filterImageGPU(Proxy*, const SkBitmap& src, SkBitmap* result, S
kIPoint* offset); |
116 | 117 |
117 /** | 118 /** |
118 * Returns whether this image filter is a color filter and puts the color f
ilter into the | 119 * Returns whether this image filter is a color filter and puts the color f
ilter into the |
119 * "filterPtr" parameter if it can. Does nothing otherwise. | 120 * "filterPtr" parameter if it can. Does nothing otherwise. |
120 * If this returns false, then the filterPtr is unchanged. | 121 * If this returns false, then the filterPtr is unchanged. |
121 * If this returns true, then if filterPtr is not null, it must be set to a
ref'd colorfitler | 122 * If this returns true, then if filterPtr is not null, it must be set to a
ref'd colorfitler |
122 * (i.e. it may not be set to NULL). | 123 * (i.e. it may not be set to NULL). |
123 */ | 124 */ |
124 virtual bool asColorFilter(SkColorFilter** filterPtr) const; | 125 virtual bool asColorFilter(SkColorFilter** filterPtr) const; |
125 | 126 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // Default impl copies src into dst and returns true | 160 // Default impl copies src into dst and returns true |
160 virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*); | 161 virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*); |
161 | 162 |
162 private: | 163 private: |
163 typedef SkFlattenable INHERITED; | 164 typedef SkFlattenable INHERITED; |
164 int fInputCount; | 165 int fInputCount; |
165 SkImageFilter** fInputs; | 166 SkImageFilter** fInputs; |
166 }; | 167 }; |
167 | 168 |
168 #endif | 169 #endif |
OLD | NEW |