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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 static void WrapTexture(GrTexture* texture, int width, int height, SkBitmap*
result); | 179 static void WrapTexture(GrTexture* texture, int width, int height, SkBitmap*
result); |
180 | 180 |
181 /** | 181 /** |
182 * Recursively evaluate this filter on the GPU. If the filter has no GPU | 182 * Recursively evaluate this filter on the GPU. If the filter has no GPU |
183 * implementation, it will be processed in software and uploaded to the GPU. | 183 * implementation, it will be processed in software and uploaded to the GPU. |
184 */ | 184 */ |
185 bool getInputResultGPU(SkImageFilter::Proxy* proxy, const SkBitmap& src, con
st Context&, | 185 bool getInputResultGPU(SkImageFilter::Proxy* proxy, const SkBitmap& src, con
st Context&, |
186 SkBitmap* result, SkIPoint* offset) const; | 186 SkBitmap* result, SkIPoint* offset) const; |
187 #endif | 187 #endif |
188 | 188 |
189 /** | |
190 * Set an external cache to be used for all image filter processing. This | |
191 * will replace the default intra-frame cache. | |
192 */ | |
193 static void SetExternalCache(Cache* cache); | |
194 | |
195 /** | |
196 * Returns the currently-set external cache, or NULL if none is set. | |
197 */ | |
198 static Cache* GetExternalCache(); | |
199 | |
200 SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter) | 189 SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter) |
201 | 190 |
202 protected: | 191 protected: |
203 class Common { | 192 class Common { |
204 public: | 193 public: |
205 Common() {} | 194 Common() {} |
206 ~Common(); | 195 ~Common(); |
207 | 196 |
208 /** | 197 /** |
209 * Attempt to unflatten the cropRect and the expected number of input f
ilters. | 198 * Attempt to unflatten the cropRect and the expected number of input f
ilters. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 */ | 324 */ |
336 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 325 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
337 Common localVar; \ | 326 Common localVar; \ |
338 do { \ | 327 do { \ |
339 if (!localVar.unflatten(buffer, expectedCount)) { \ | 328 if (!localVar.unflatten(buffer, expectedCount)) { \ |
340 return NULL; \ | 329 return NULL; \ |
341 } \ | 330 } \ |
342 } while (0) | 331 } while (0) |
343 | 332 |
344 #endif | 333 #endif |
OLD | NEW |