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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 * GrEffect, used to process this filter on the GPU, or false if | 86 * GrEffect, used to process this filter on the GPU, or false if |
87 * not. | 87 * not. |
88 * | 88 * |
89 * If effect is non-NULL, a new GrEffect instance is stored | 89 * If effect is non-NULL, a new GrEffect instance is stored |
90 * in it. The caller assumes ownership of the stage, and it is up to the | 90 * in it. The caller assumes ownership of the stage, and it is up to the |
91 * caller to unref it. | 91 * caller to unref it. |
92 * | 92 * |
93 * The effect can assume its vertexCoords space maps 1-to-1 with texels | 93 * The effect can assume its vertexCoords space maps 1-to-1 with texels |
94 * in the texture. | 94 * in the texture. |
95 */ | 95 */ |
96 virtual bool asNewEffect(GrEffectRef** effect, GrTexture*) const; | 96 virtual GrEffectRef* asNewEffect(GrTexture*) const; |
97 | 97 |
98 /** | 98 /** |
99 * Returns true if the filter can be processed on the GPU. This is most | 99 * Returns true if the filter can be processed on the GPU. This is most |
100 * often used for multi-pass effects, where intermediate results must be | 100 * often used for multi-pass effects, where intermediate results must be |
101 * rendered to textures. For single-pass effects, use asNewEffect(). | 101 * rendered to textures. For single-pass effects, use asNewEffect(). |
bsalomon
2013/04/08 17:52:17
It seems like this comment should be updated to sa
| |
102 * The default implementation returns false. | 102 * The default implementation returns false. |
103 */ | 103 */ |
104 virtual bool canFilterImageGPU() const; | 104 virtual bool canFilterImageGPU() const; |
105 | 105 |
106 /** | 106 /** |
107 * Process this image filter on the GPU. src is the source image for | 107 * Process this image filter on the GPU. This is most often used for |
108 * processing, as a texture-backed bitmap. result is the destination | 108 * multi-pass efefects, where intermediate results must be rendered to |
109 * bitmap, which should contain a texture-backed pixelref on success. | 109 * textures. For single-pass effects, use asNewEffect(). src is the |
110 * The default implementation returns returns false and ignores the | 110 * source image for processing, as a texture-backed bitmap. result is |
111 * result parameter. | 111 * the destination bitmap, which should contain a texture-backed pixelref |
112 * on success. The default implementation does single-pass processing | |
113 * using asNewEffect(). If asNewEffect() returns NULL, the default | |
114 * implementation returns false. | |
112 */ | 115 */ |
113 virtual bool filterImageGPU(Proxy*, const SkBitmap& src, SkBitmap* result); | 116 virtual bool filterImageGPU(Proxy*, const SkBitmap& src, SkBitmap* result); |
114 | 117 |
115 /** | 118 /** |
116 * 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 |
117 * "filterPtr" parameter if it can. Does nothing otherwise. | 120 * "filterPtr" parameter if it can. Does nothing otherwise. |
118 * If this returns false, then the filterPtr is unchanged. | 121 * If this returns false, then the filterPtr is unchanged. |
119 * 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 |
120 * (i.e. it may not be set to NULL). | 123 * (i.e. it may not be set to NULL). |
121 */ | 124 */ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 SkBitmap getInputResult(int index, Proxy*, const SkBitmap& src, const SkMatr ix&, | 165 SkBitmap getInputResult(int index, Proxy*, const SkBitmap& src, const SkMatr ix&, |
163 SkIPoint*); | 166 SkIPoint*); |
164 | 167 |
165 private: | 168 private: |
166 typedef SkFlattenable INHERITED; | 169 typedef SkFlattenable INHERITED; |
167 int fInputCount; | 170 int fInputCount; |
168 SkImageFilter** fInputs; | 171 SkImageFilter** fInputs; |
169 }; | 172 }; |
170 | 173 |
171 #endif | 174 #endif |
OLD | NEW |