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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 static SkImageFilter* CreateMatrixFilter(const SkMatrix& matrix, | 241 static SkImageFilter* CreateMatrixFilter(const SkMatrix& matrix, |
242 SkFilterQuality, | 242 SkFilterQuality, |
243 SkImageFilter* input = NULL); | 243 SkImageFilter* input = NULL); |
244 | 244 |
245 #if SK_SUPPORT_GPU | 245 #if SK_SUPPORT_GPU |
246 /** | 246 /** |
247 * Wrap the given texture in a texture-backed SkBitmap. | 247 * Wrap the given texture in a texture-backed SkBitmap. |
248 */ | 248 */ |
249 static void WrapTexture(GrTexture* texture, int width, int height, SkBitmap*
result); | 249 static void WrapTexture(GrTexture* texture, int width, int height, SkBitmap*
result); |
250 | 250 |
251 /** | 251 // Helper function which invokes GPU filter processing on the |
252 * Recursively evaluate this filter on the GPU. If the filter has no GPU | 252 // input at the specified "index". If the input is null, it leaves |
253 * implementation, it will be processed in software and uploaded to the GPU. | 253 // "result" and "offset" untouched, and returns true. If the input |
254 */ | 254 // has a GPU implementation, it will be invoked directly. |
255 bool getInputResultGPU(SkImageFilter::Proxy* proxy, const SkBitmap& src, con
st Context&, | 255 // Otherwise, the filter will be processed in software and |
256 SkBitmap* result, SkIPoint* offset) const; | 256 // uploaded to the GPU. |
| 257 bool filterInputGPU(int index, SkImageFilter::Proxy* proxy, const SkBitmap&
src, const Context&, |
| 258 SkBitmap* result, SkIPoint* offset) const; |
257 #endif | 259 #endif |
258 | 260 |
259 SK_TO_STRING_PUREVIRT() | 261 SK_TO_STRING_PUREVIRT() |
260 SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter) | 262 SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter) |
261 | 263 |
262 protected: | 264 protected: |
263 class Common { | 265 class Common { |
264 public: | 266 public: |
265 Common() {} | 267 Common() {} |
266 ~Common(); | 268 ~Common(); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 */ | 420 */ |
419 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 421 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
420 Common localVar; \ | 422 Common localVar; \ |
421 do { \ | 423 do { \ |
422 if (!localVar.unflatten(buffer, expectedCount)) { \ | 424 if (!localVar.unflatten(buffer, expectedCount)) { \ |
423 return NULL; \ | 425 return NULL; \ |
424 } \ | 426 } \ |
425 } while (0) | 427 } while (0) |
426 | 428 |
427 #endif | 429 #endif |
OLD | NEW |