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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 // "result" and "offset" untouched, and returns true. If the input | 285 // "result" and "offset" untouched, and returns true. If the input |
286 // has a GPU implementation, it will be invoked directly. | 286 // has a GPU implementation, it will be invoked directly. |
287 // Otherwise, the filter will be processed in software and | 287 // Otherwise, the filter will be processed in software and |
288 // uploaded to the GPU. | 288 // uploaded to the GPU. |
289 bool filterInputGPUDeprecated(int index, SkImageFilter::Proxy* proxy, | 289 bool filterInputGPUDeprecated(int index, SkImageFilter::Proxy* proxy, |
290 const SkBitmap& src, const Context&, | 290 const SkBitmap& src, const Context&, |
291 SkBitmap* result, SkIPoint* offset) const; | 291 SkBitmap* result, SkIPoint* offset) const; |
292 #endif | 292 #endif |
293 | 293 |
294 SK_TO_STRING_PUREVIRT() | 294 SK_TO_STRING_PUREVIRT() |
| 295 SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter) |
295 | 296 |
296 protected: | 297 protected: |
297 class Common { | 298 class Common { |
298 public: | 299 public: |
299 /** | 300 /** |
300 * Attempt to unflatten the cropRect and the expected number of input f
ilters. | 301 * Attempt to unflatten the cropRect and the expected number of input f
ilters. |
301 * If any number of input filters is valid, pass -1. | 302 * If any number of input filters is valid, pass -1. |
302 * If this fails (i.e. corrupt buffer or contents) then return false an
d common will | 303 * If this fails (i.e. corrupt buffer or contents) then return false an
d common will |
303 * be left uninitialized. | 304 * be left uninitialized. |
304 * If this returns true, then inputCount() is the number of found input
filters, each | 305 * If this returns true, then inputCount() is the number of found input
filters, each |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 */ | 487 */ |
487 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 488 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
488 Common localVar; \ | 489 Common localVar; \ |
489 do { \ | 490 do { \ |
490 if (!localVar.unflatten(buffer, expectedCount)) { \ | 491 if (!localVar.unflatten(buffer, expectedCount)) { \ |
491 return NULL; \ | 492 return NULL; \ |
492 } \ | 493 } \ |
493 } while (0) | 494 } while (0) |
494 | 495 |
495 #endif | 496 #endif |
OLD | NEW |